ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: xxcaptainxx on August 08, 2008, 05:22:28 PM

Title: Looking for the master
Post by: xxcaptainxx on August 08, 2008, 05:22:28 PM
I would desperately love to learn to make scripts, but alas i am kind of clueless anyone care to be my teacher?
Title: Re: Looking for the master
Post by: TrailMyx on August 08, 2008, 05:27:16 PM
I would desperately love to learn to make scripts, but alas i am kind of clueless anyone care to be my teacher?


Well, best is to pick a script that you use, but might like to modify for your own purpose.  Then just modify it.  If you have questions, post'em up and we can certainly try and help you.
Title: Re: Looking for the master
Post by: xxcaptainxx on August 08, 2008, 05:32:19 PM
not sure how to modify them as i am un knowing to commands and all i mean i ahve added item support and all but not much else i don't know were to begin
Title: Re: Looking for the master
Post by: TrailMyx on August 08, 2008, 05:36:52 PM
not sure how to modify them as i am un knowing to commands and all i mean i ahve added item support and all but not much else i don't know were to begin

Well, the best thing is to start small and just look at the scripts that you run and try and understand them.  Visit the EasyUO Wiki help section to see what each of the commands do and try to compare the information in the Wiki help with the command in the script you're running.  If you load a script in ScriptUO, and highlight a command, you can get the specific Wiki help for each command.  This might help so you don't have to go hunting all over.
Title: Re: Looking for the master
Post by: Khameleon on August 08, 2008, 09:00:51 PM
how I learned.. and lol still do for some idea's... I started out by looking at all the commands.
like Move, Finditem, ect.. small things and I wrote a small script
ex:
Finditem xxx
halt
I would then look at the findid findtype. then I would just play around with it.
finditem xxx
if findkind <> -1
display ok Found!
else
display ok not found
HALT

or
Set %x #Charposx + 5
Set %y #CharPosy - 5
Move %X %Y
HALT

there are some examples in the wiki of easyuo docs.
take a look at some of them.



or find a small script and use F8 to single step through it and see what each line does..
I've spend countless hours stepping threw TM's CLaw and I still have no idea what some of the script does :P

Title: Re: Looking for the master
Post by: TrailMyx on August 08, 2008, 09:10:55 PM
I've spend countless hours stepping threw TM's CLaw and I still have no idea what some of the script does :P

Same here.  Oh wait...  heh.
Title: Re: Looking for the master
Post by: rana70 on August 08, 2008, 09:26:34 PM
Quote
findkind <> -1

buuuuhhhh

findcnt rules  ;)
Title: Re: Looking for the master
Post by: Tidus on August 11, 2008, 12:23:37 PM
the way i have learned to script is by starting easy.  It doesn't really matter if someone else has already done it. Say you want to make a script that does something easy. I want to make a script that heals me with bandies.  So you go through your set-up in chronological order.  How do i make this script heal me? so do it in steps

Check to see if hurt
If hurt then heal me
Do the heal
repeat


So then you start to fill in the blanks of how do i get my steps to do what i want?

main:
gosub check
gosub heal
goto main


sub check
Do my Checks

sub heal
if hurt heal

Now at that point you have broken it down to tell EUO what it is going to be done.  So you fill in your blanks again.

sub check
if #hits < #maxhits
 return %true
return %false

sub heal
if #result %true
 {
 event macro 58
 return
 }
return

So at that point you now have your script. (Script might not be fully correct because i'm doing this at work).  The next step at this point would be to post up your work in a debug area and ask people to test it and give you advise on how it should be written or what else could make it better.  Trial and Error is your best bet in learning.  I remember looking at script going wtf does that mean?  and now as i am getting my Computer Science degree i'm going, this makes so much sense now. I just love scripting to write the stuff, not always to see that i am gaining gold.