ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Pop Rock on January 02, 2011, 06:24:14 PM

Title: Scripting help please?
Post by: Pop Rock on January 02, 2011, 06:24:14 PM
Ok I am new to writing scripts, so I don't know all the stuff about it but I have been reading all the tutorials I can get my hands on. So I have a question: How do you drag 80 cloth from a giant beetle and put it in your backpack? And can you explain how this works if its not to much to ask? I know you use the event drag but I can't figure out how to specify that I only want 80 cloth.... This is what I have so far:
sub %get_cloth
 findItem CUI
 event drag
Now how do I specify how many cloth and specify to put it in my pack?
Thank you in advance to whoever helps me out!
Title: Re: Scripting help please?
Post by: Dixie Wrecked on January 02, 2011, 06:56:01 PM
OK, I am going to assume you're correct on CUI being the right ID for cloth, but here is one way to do it:

Code: [Select]
sub get_cloth ; note no % in the sub name
finditem CUI c_ , %beetlebackpack ; assumes you have the ID for the beetle's backpack set to the variable %beetlebackpack, since you said you wanted to find it in the beetlepack; also assumes the beetle's pack is opened already as well
if #findcnt > 0
  {
  exevent drag #findid 80 ; the 80 tells it to drag 80; using #findstack would drag the entire stack
  wait 10
  exevent dropc #backpackid ; drops into your char's backpack
  wait 10
  }
return ; this will exit the sub, but the script won't know if it moved anything; using return #FALSE would be a way to say it failed, but "return #TRUE" should be inserted between "wait 10" and "}" above if you want to let the script know if the move was successful

Also, the "wait 10"s may not be needed, but I usually leave them in when I know I may experience lag.
Title: Re: Scripting help please?
Post by: Pop Rock on January 03, 2011, 07:24:55 AM
Thank you soooo much that makes more sense now. :)
Title: Re: Scripting help please?
Post by: Pop Rock on January 08, 2011, 08:18:50 AM
Ok new question: How do I use the buttons on a sewing kit menu? I already figured out how to find and use the sewing kit, but everytime it opens, wherever my cursor is, the middle of the menu is there (does that make any sense?) so that makes it to if i use the click command in a certain x and y axis on easy uo program, and the button isnt there, then it won't work. So I was wondering if anyone could help me out with using the buttons on the menu...

Post Merge: January 08, 2011, 04:20:37 PM
Is it even possible to use easyuo to craft stuff using buttons not clicking?

Post Merge: January 09, 2011, 01:09:34 PM
Ok Dixie Wrecked I put in your what you said about draging the cloth... but it won't work. Did I do it wrong? This is what it looks like:
sub restock
 finditem %cloth c_ , %beetlepackid
 if #findcnt > 0
  {
  exevent drag %cloth 80
  wait 10
  exevent dropc #backpackid
  wait 10
  }
return
Title: Re: Scripting help please?
Post by: Scrripty on January 16, 2011, 11:23:33 AM
You should really make that bottom wait 10 a wait 20 on OSI shards. :)  You can also take that middle wait 10 out completely with a decent connection.
Title: Re: Scripting help please?
Post by: dxrom on January 16, 2011, 11:49:28 AM
Is the beetle's bag open? You may need to write a script that opens the bag before you can pull cloth out.
Title: Re: Scripting help please?
Post by: Dixie Wrecked on January 16, 2011, 02:52:08 PM

Post Merge: January 09, 2011, 01:09:34 PM
Ok Dixie Wrecked I put in your what you said about draging the cloth... but it won't work. Did I do it wrong? This is what it looks like:
sub restock
 finditem %cloth c_ , %beetlepackid
 if #findcnt > 0
  {
  exevent drag %cloth 80
  wait 10
  exevent dropc #backpackid
  wait 10
  }
return

Without seeing all of the code, there might be other problems, but a few things to make sure of:
1) you have set %cloth XXX somewhere above this (where XXX is the ID for cloth)
2) it should be exevent drag #findid 80, not exevent drag %cloth 80 (compare it to my original post and you'll see it also said #findid)
3) make sure the beetle's backpack is open; if not, then it can't find anything to drag
4) As Twinkle McNugget said, the waits may need to be changed/deleted, although I find that I need them sometimes, so I just let them stay (you'll have to test it yoursself, as everyone's connection is different)
Title: Re: Scripting help please?
Post by: Scrripty on January 16, 2011, 03:24:14 PM
After an exevent drop of any type you really should have a wait 20.  Not a wait 10. ;)
Title: Re: Scripting help please?
Post by: Pop Rock on January 20, 2011, 04:05:28 PM
Haha that worked thanks guys :)