Scripting Resources & Utilities > OpenEUO Scripting Tutorials

First script - Simple item mover

(1/9) > >>

Cerveza:
Ok, here's what I want it to do....

Display a gump asking me to target the source container
I click on OK and a target cursor comes up
I click on the source container and it opens
Display a gump asking me to target the destination container
I click on OK and a target cursor comes up
I click on the destination container and it opens
A gump comes up with Yes/No and asks if I want to specify item type
If YES then a target cursor pops up and I click on the type in the source container, it then moves all of that type from source to destination
If NO then it begins moving everything from source to destination
Once complete it asks if I want to go again
If YES go to start
If NO end

So far I have


--- Code: ---
--- End code ---
:(

Khameleon:
damn.. you got farther then me..

Endless Night:
Well not quiet exactly what you asked for .. moves itemtype from whereever to destination bag.  

Took me quiet awhile...

EDIT: Code deleted .. ok ok i realised that was way to extensive for starting out .. lets do it section by section.. see post below...

Cerveza:
How do you get item type?

OK, lets try this.... break this down line by line in OEUO

Display a gump asking me to target the source container

How do I do that? Are popups even possible??

Endless Night:
How do you get item type?
Same way you did in EUO .. target item. get item id .. finditem.. get item type.

Display a gump asking me to target the source container
How do I do that? Are popups even possible??
popups are possible im not sure how yet so cuase im starting out same as you i used msg overhead of character..

LUA --   = EUO ;  .. ie it marks as a comment.


Step 1 code below
Display a gump asking me to target the source container  (EXMSg not gump for now)
I click on OK and a target cursor comes up
I click on the source container and it opens


--- Code: ----- step 1 target and open bag
UO.LTargetKind = 1 -- object
UO.ExMsg(UO.CharID  ,'Target the Source Containor:')  -- Message above character
UO.TargCurs = true    -- make a target cursor
while UO.TargCurs == true do  wait(10) end     -- wait until something is clicked (ie notarget cursor)
nSourceBag = UO.LTargetID   -- set the bagid = the object clicked
UO.LObjectID = nSourceBag     -- set last object to the object clicked
UO.Macro(17,0) -- openbag ( invoke macro use last object which hopefully is a bag inwhich case opens bag )

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version