Your question has been asked and answered a number of times. I suggest that you see Similar Threads listed below and/or use the Search function above and put the word "autolisp" in the search box.
Also, visit the AutoLISP Archive and check out some of the routines there.
I suggest you click on the Links button above and go through the list. Two sites I recommend are AfraLisp and Jeffery P Sanders if you want to learn more about the subject.
(defun c:test2 (/) ; defun is where you put your function name the c: means your can run it from command window.(cond ; cond is just a way to say if condition x is right do this as you see below( (= 3 3) (princ "True") ) ; princ puts some text in your cmd screen like this will put true in your command windows because 3 is equal to 3 Try it out!( (= 4 2) (princ "True") ) ;skips because 4 does not equal 2( (= 4 1) (princ "True") ) ;skips because 4 does not equal 1( T (princ "Nothing") ) ; prints "Nothing" if nothing is true.) )
(if (tblsearch "BLOCK" "template") (searches for a block called template if it is there it goes to next line) (progn (must be used if you want to do more then one line after the if)
Since I just started myself I know how hard it is to learn a little bit, so I hope this gets you on your way like it did with me.
Here a simple box with a couple of twists pick two points then the side for the box with an offset chucked in.
As I have said before to many people who want to learn lisp vba etc get yourself a project to achieve 1st its not much good just reading the tutorials, pick something simple like drawing a box and get more and more complex.
The simplest task like drawing a pit we do every day yet we never bothered to do it after years of cad! Did it the other day and it took about 15 minutes.