ScriptUO

Scripting Resources & Utilities => OEUO => OpenEUO Scripting Tutorials => Topic started by: Cerveza on October 13, 2010, 05:19:05 PM

Title: First script - Simple item mover
Post by: Cerveza on October 13, 2010, 05:19:05 PM
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: [Select]
:(
Title: Re: First script - Simple item mover
Post by: Khameleon on October 13, 2010, 05:26:30 PM
damn.. you got farther then me..
Title: Re: First script - Simple item mover
Post by: Endless Night on October 13, 2010, 07:36:47 PM
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...
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 02:50:42 AM
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??
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 04:30:01 AM
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: [Select]
-- 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 )
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 04:57:10 AM
Now becuase step 2 is the same as step 1 .. lets turn step 1 into a Function (Sub) with 1 parameters (passed varialbes) of popup message and 1 returned variable of bagid

Step 1
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

Step 2
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

Note In LUA all function (sub) declarations must be at the top of the script.  You declare a function in this format
function Functionaname ( passedvariablenames spereated by commas )   
Inside the function issue a return <returned variables seperated by comma's thier can be as many as you want>

Code: [Select]
function TargetOpenBag(sMessage)
  UO.LTargetKind = 1 -- object
  UO.ExMsg(UO.CharID  , sMessage)  -- 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)
  UO.LObjectID = UO.LTargetID    -- 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 )
  return  UO.LTargetID  -- set the return value .. the bagid clicked
end


Now to call the function we dont have to use a gosub or otherstamtne.. once the function is declared to access it we use its name just like any other command.

TOretrive the returned value/s of a function you do it on the line calling the function
ie   <returned values seperated by commas> = functionname(function parameters)

so new code becomes

Code: [Select]
-----------------------------
-- Defined Functions (subs)
-----------------------------
function TargetOpenBag(sMessage)
  UO.LTargetKind = 1 -- object
  UO.ExMsg(UO.CharID  , sMessage)  -- 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)
  UO.LObjectID = UO.LTargetID    -- 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 )
  return  UO.LTargetID  -- set the return value .. the bagid clicked
end

-----------------------------
-- Script Starts Below
-----------------------------
local nSourceBag = TargetOpenBag('Please Target The Source Bag:')           -- step 1
local nDestinationBag = TargetOpenBag('Please Target The Destination Bag:') -- step 2

NOTE the declaring local of the nsourcebag and ndestinationbag  .. i dont want them to be global variables the default.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 05:00:30 AM
Hey I was going to do that second part LOL....

So in OEUO everything is loaded into memory, then executed... should be fast...
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 05:03:13 AM
OpenEUO is fast... making sense so far...??
Title: Re: First script - Simple item mover
Post by: Paulonius on October 14, 2010, 05:03:40 AM
Okay,how about an option for picking things up off of the ground?
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 05:08:28 AM
Hey Paul go get your own post LOL.

I still have to find stuff in the source and move it to the destination....
Title: Re: First script - Simple item mover
Post by: Paulonius on October 14, 2010, 05:12:18 AM
Ha. Just trying to help, didn't mean to skip ahead.  I use an item mover I wrote a while ago constantly. Its definitely the first script I want too.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 05:16:46 AM
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 06:22:43 AM
ShowMsg no longer works.. this is going to be a bit of a pita.. but some ripped code gives me this function...
Ripped from: http://www.easyuo.com/forum/viewtopic.php?p=376784#376784  
Get the function MsgBox

Code: [Select]
function msgbox(default, prompt, title, button, icon)
  -- Function By Traegon's, Link: http://www.easyuo.com/forum/viewtopic.php?p=376784#376784
  if icon == nil then icon = 2 end
  if default == true then default = 1 else default = 0 end
 
  ConfirmDialog = Obj.Create("TMessageBox")
  ConfirmDialog.Title = title
  ConfirmDialog.Button = button
  ConfirmDialog.Icon = icon
  ConfirmDialog.Default = default
  return ConfirmDialog.Show(prompt)
end

nResult = msgbox(true,"Select ITem Type: ?", "Select ItemType", 4)   -- nResult = 6 = yes   7 = no

Well i think we need a simple wrapper around his function to make it easier to use.. im gonig to define a function that calls his function

Code: [Select]
function MessageBox(sPrompt, sTitle, sType)
  if sType == 'OK'    then  return msgbox(true, sPrompt, sTitle, 0,4) end
  if sType == 'YESNO' then  return msgbox(true, sPrompt, sTitle, 4,3) end
end

going to use it like this

Code: [Select]
 MessageBox(sMessage, 'Bag Selection:', 'OK' )
  MessageBox('Select Item Type', 'Type Selection' , 'YESNO')
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 06:37:38 AM
Moving on and implementing above.. script starting to grow..

Code: [Select]
-------------------------------------------------------
-- Functions (subs) - Ive ripped from others per credits
-------------------------------------------------------
function msgbox(default, prompt, title, button, icon)
  -- Function By Traegon's, Link: http://www.easyuo.com/forum/viewtopic.php?p=376784#376784
  if icon == nil then icon = 2 end
  if default == true then default = 1 else default = 0 end
  
  ConfirmDialog = Obj.Create("TMessageBox")
  ConfirmDialog.Title = title
  ConfirmDialog.Button = button
  ConfirmDialog.Icon = icon
  ConfirmDialog.Default = default
  return ConfirmDialog.Show(prompt)
endend

-----------------------------
-- My Defined Functions (subs)
-----------------------------
function MessageBox(sPrompt, sTitle, sType)
  if sType == 'OK'    then  return msgbox(true, sPrompt, sTitle, 0,4) end
  if sType == 'YESNO' then  return msgbox(true, sPrompt, sTitle, 4,3) end
end

function TargetOpenBag(sMessage)
  UO.LTargetKind = 1 -- object
  MessageBox(sMessage, 'Bag Selection:', 'OK' )  
  UO.TargCurs = true    -- make a target cursor
  while UO.TargCurs == true do  wait(10) end     -- wait until something is clicked (ie notarget cursor)
  UO.LObjectID = UO.LTargetID    -- 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 )
  return  UO.LTargetID  -- set the return value .. the bagid clicked
end

-----------------------------
-- Script Starts Below
-----------------------------
local nSourceBag = TargetOpenBag('Please Target The Source Bag:')           -- step 1
local nDestinationBag = TargetOpenBag('Please Target The Destination Bag:') -- step 2
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 06:54:36 AM
Ok here we go

step 3
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

Code: [Select]
local nResult = MessageBox('Move Items By ItemType ?','Item Type', 'YESNO')
if nResult == 6 then
  MessageBox('Select Item Type','Item Type', 'OK')
  UO.TargCurs = true
  while UO.TargCurs == true do  wait(10) end
  -- Tricky bit Get ITem Type from UO.LTargetID
  -- move items of type x from nsource to ndestination
  else
  -- move all items from nsource to ndestination
  end


Notice thiers a bunch of bits not done .. lets call that step3b and 3c and we will come back to that.. moving on

STEP 4
Once complete it asks if I want to go again
If YES go to start
If NO end


A simple loop wrapper will surfice (note in lua after the last line of code the script ends you dont have to tell it do it just does).


Code: [Select]
repeat
  --.. prior code
  local nResult = MessageBox('Do Another Move Item ?','Move Item', 'YESNO')
until nResult == 7 -- no


Replace this section
Code: [Select]
-----------------------------
-- Script Starts Below
-----------------------------
repeat
  local nSourceBag = TargetOpenBag('Please Target The Source Bag:')           -- step 1
  local nDestinationBag = TargetOpenBag('Please Target The Destination Bag:') -- step 2
  local nResult = MessageBox('Move Items By ItemType ?','Item Type', 'YESNO')
  if nResult == 6 then
    MessageBox('Select Item Type','Item Type', 'OK')
    UO.TargCurs = true
    while UO.TargCurs == true do  wait(10) end
    -- step 3b Tricky bit Get ITem Type from UO.LTargetID  
    -- step 3c move items of type x from nsource to ndestination
  else
    -- step 3c move all items from nsource to ndestination
  end
 
  local nResult = MessageBox('Do Another Move Item ?','Move Item', 'YESNO')
until nResult == 7 -- no

Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 07:01:44 AM
I'm kinda understanding it so far... looks like a lot of holes yet though.
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 07:03:39 AM
I'm kinda understanding it so far... looks like a lot of holes yet though.

only steps 3b and 3c for completion.   step 3b is another leaning curve... 3c same old same old
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 07:59:05 AM
step 3b
Get ITem Type from UO.LTargetID

Well in EUO this would have been farily simple
Code: [Select]
finditem #ltargetid
If #findcnt > 0
  set !ITemType #findtype

OpenEUO does not filter finditem results instead it returns results as if you did finditem *, so you have to the filtering yourself.

Now this is going to be a bit of code were going to use over and over perhaps in many scripts. Thierfor it makes sense to turn it into a sub/function

Code: [Select]
function ENs_GetItemTypeFromItemID(nItemID)
  local nThisType = nil
  local nCnt = UO.ScanItems(true) -- visible only
  local nIndex = 0
  while nIndex < nCnt and nThisType == nil do
    local nID,nType,nKind,nContID,nX,nY,nZ,nStack,nRep,nCol = UO.GetItem(nIndex)
    if nID == nItemID then nThisType = nType end
    nIndex = nIndex + 1
    end
  return nThisType
end

What does this sub do... finditem *   .. then it iterates throw each of the founditems looknig for the one that matches the ID we passed as an argument.  When it finds it .. it returns the itemtype value.

So in our main code we replace the comment line with .
Code: [Select]
   nItemTypeToMove = ENs_GetItemTypeFromItemID(UO.LTargetID)
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 08:16:20 AM
Step 3c
Not above i referenced 3c in 2 different ways. 
a) move items of type x from source containor to destination containor
b) move all items from source containor to destination containor

This is also a sub that will be used many times from many scripts thier for a function is called for

Code: [Select]
function ENs_MoveITemsFromTo(nFromBag, nToBag, nItemType)  -- pass nitemtype -1 if not by type
 local nMoved = 0
 for nIndex = 0 , UO.ScanItems(true)-1 do
   local nID,nType,nKind,nContID,nX,nY,nZ,nStack,nRep,nCol = UO.GetItem(nIndex)
   if nContid == nFromBag then
     if ( nItemType ~= -1 and nType == nItemType ) or nItemType == -1 then
        nMoved = nMoved + ENs_MoveItemToContainor(nID , nToBag )  end
     end
 end
 return nMoved
end

function ENs_MoveItemToContainor(nID , nContID)
  UO.Drag(nID)
  wait(600)
  UO.DropC(nContID)
  wait(600)
  return 1
end


We shall call it like this in the 2 different instances
Quote
local nItemsMoved = ENs_MoveITemsFromTo(nSourceBag, nDestinationBag, nItemTypeToMove)  -- if nItemTypeToMove = -1 it moves all items in souce bag


Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 08:25:26 AM
Bonus Points
The script is done.    But we made some nice functions in this project that i think i will use over and over.   And as such i dont want to include them in my script and clutter it up.  So im going to cut out the functions into my first main sub library that i can call from every script i write.

So imgoing to create 2 files
MyLibrary.lua  and ItemMover.lua  

In ItemMover.lua im going to reference mylibrary.lua like so
Code: [Select]
dofile('MyLibrary.lua')
Contents of MyLibrary.lua
Code: [Select]
-------------------------------------------------------
-- Functions (subs) - Ive ripped from others per credits
-------------------------------------------------------
function msgbox(default, prompt, title, button, icon)
   -- Function By Traegon's, Link: http://www.easyuo.com/forum/viewtopic.php?p=376784#376784
  if icon == nil then icon = 2 end
  if default == true then default = 1 else default = 0 end
 
  ConfirmDialog = Obj.Create("TMessageBox")
  ConfirmDialog.Title = title
  ConfirmDialog.Button = button
  ConfirmDialog.Icon = icon
  ConfirmDialog.Default = default
  return ConfirmDialog.Show(prompt)
end

function ENs_GetItemTypeFromItemID(nItemID)
  local nThisType = nil
  local nCnt = UO.ScanItems(true) -- visible only
  local nIndex = 0
  while nIndex < nCnt and nThisType == nil do
    local nID,nType,nKind,nContID,nX,nY,nZ,nStack,nRep,nCol = UO.GetItem(nIndex)
    if nID == nItemID then nThisType = nType end
    nIndex = nIndex + 1
    end
  return nThisType
end

function ENs_MoveItemsFromTo(nFromBag, nToBag, nItemType)  -- pass nitemtype -1 if not by type
 local nMoved = 0
 for nIndex = 0 , UO.ScanItems(true)-1 do
   local nID,nType,nKind,nContID,nX,nY,nZ,nStack,nRep,nCol = UO.GetItem(nIndex)
   if nContID == nFromBag then
     if ( nItemType ~= -1 and nType == nItemType ) or nItemType == -1 then
        nMoved = nMoved + ENs_MoveItemToContainor(nID , nToBag )  end
     end
 end
 return nMoved
end

function ENs_MoveItemToContainor(nID , nContID)
  UO.Drag(nID)
  wait(600)
  UO.DropC(nContID)
  wait(600)
  return 1
end

-----------------------------
-- My Defined Functions (subs)
-----------------------------
function MessageBox(sPrompt, sTitle, sType)
  if sType == 'OK'    then  return msgbox(true, sPrompt, sTitle, 0,4) end
  if sType == 'YESNO' then  return msgbox(true, sPrompt, sTitle, 4,3) end
end

function TargetOpenBag(sMessage)
  UO.LTargetKind = 1 -- object
  MessageBox(sMessage, 'Bag Selection:', 'OK' )  
  UO.TargCurs = true    -- make a target cursor
  while UO.TargCurs == true do  wait(10) end     -- wait until something is clicked (ie notarget cursor)
  UO.LObjectID = UO.LTargetID    -- 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 )
  return  UO.LTargetID  -- set the return value .. the bagid clicked
end


Contents of ItemMover.lua
Code: [Select]
-----------------------------
--Load Code Librarys
-----------------------------
dofile('MyLibrary.lua')

-----------------------------
-- Script Starts Below
-----------------------------
repeat
  local nSourceBag = TargetOpenBag('Please Target The Source Bag:')           -- step 1
  local nDestinationBag = TargetOpenBag('Please Target The Destination Bag:') -- step 2
  local nResult = MessageBox('Move Items By ItemType ?','Item Type', 'YESNO')
  local nItemTypeToMove = -1   -- not by type
  if nResult == 6 then
    MessageBox('Select Item Type','Item Type', 'OK')
    UO.TargCurs = true
    while UO.TargCurs == true do  wait(10) end
    nItemTypeToMove = ENs_GetItemTypeFromItemID(UO.LTargetID)
    end
  local nItemsMoved = ENs_MoveItemsFromTo(nSourceBag, nDestinationBag, nItemTypeToMove)  -- if nItemTypeToMove = -1 it moves all items in souce bag
  local nResult = MessageBox('Moved '..nItemsMoved..' items. Move more Items ?','Move Item', 'YESNO')
until nResult == 7 -- no
  


EDITED: To fix 2 capitilation typos
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 08:26:42 AM
Please post a comment and let me know if the tutorial helped or didnt help in any way.
cheers everyone.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 08:28:42 AM
Ok, I'll have to go through this completely to try to understand it. I'm not sure I will completely get it though.

No matter what anyone says, this is not easier then EUO.
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 08:35:07 AM
Ok, I'll have to go through this completely to try to understand it. I'm not sure I will completely get it though.

No matter what anyone says, this is not easier then EUO.

In the short run no... in the long run yes...   Once the library subs were written look at how short the code became.  So LUA will show its power and ease of use once we have a full set of library subs that do the grunt work and we can just do this

Code: [Select]
dofile('craftingsub.lua')
dofile('imbueingsubs.lua')

Makeitem('leathervest')
imbueitem(dsfdfjdjfd)
Title: Re: First script - Simple item mover
Post by: Paulonius on October 14, 2010, 08:44:18 AM
It looks like S7 is working on some of this in his Fluent initiative.

http://www.easyuo.com/forum/viewtopic.php?t=43289
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 08:48:30 AM
Fixed a typo   Uppercase L  in Local instead of lowercase l  as in local

This is one thing about lua that drives me nuts...  Local is not a command local is.
Title: Re: First script - Simple item mover
Post by: Paulonius on October 14, 2010, 08:51:45 AM
very helpful EN.  I am reading through this with your array discussion and its starting to make sense.  When I look at the code I am not seeing blonde, brunette, red-head yet, but I will keep at it.
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 09:23:43 AM
very helpful EN.  I am reading through this with your array discussion and its starting to make sense.  When I look at the code I am not seeing blonde, brunette, red-head yet, but I will keep at it.

Do one bit at a time .. put the code in your openEUO window .. run it see what it does...
After awhile you will see the apples on the trees.... the beauty from the beast ..   

I included quiet a number of advanced concepts...
how to define a function
How to use Finditem (scanitems)
How to make a code library
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 09:37:16 AM
Do one bit at a time .. put the code in your openEUO window .. run it see what it does...
After awhile you will see the apples on the trees.... the beauty from the beast ..   

I included quiet a number of advanced concepts...
how to define a function
How to use Finditem (scanitems)
How to make a code library


Function.... hmmm... find.... library.... Nope, don't get it at all. I'll continue to look at it as I know what it does. I just have no idea how it's working. Like learning another language, easy to learn to read the words, difficult to know what they mean.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 02:53:17 PM
So uhm... did you ever test this cause I'm trying it and my target cursor comes up, nothing else... and it doesn't do squat.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 02:55:31 PM
Ok, d-loaded the newest? version of OEUO and now it will bring up my target cursor and when I target something it uses it. So opens packs, opens gumps... etc...

Not the first simple example I was looking for. Thus far, I'd have to score it a fail.
Title: Re: First script - Simple item mover
Post by: Superslayer on October 14, 2010, 03:03:04 PM
Wow Endless thanks, that cleared up a bunch for me! The library thing I had assumptions about it's purpose, but I clearly see it's use now. So in essence, everyone could have there own library to call functions from and run oeuo code. Without a library, these functions would have to be hard coded into the script.

By the way, what's with all the lowercase 'n' 's in the script such as "nSourceBag" and "nContID". Is that some kind of namespace/atom thing?
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 03:05:21 PM
Wow Endless thanks, that cleared up a bunch for me! The library thing I had assumptions about it's purpose, but I clearly see it's use now. So in essence, everyone could have there own library to call functions from and run oeuo code. Without a library, these functions would have to be hard coded into the script.

By the way, what's with all the lowercase 'n' 's in the script such as "nSourceBag" and "nContID". Is that some kind of namespace/atom thing?

good dam question... its varialbe type nameing so i can easily see what the var holds. Lua unlike EASYUO is specific about what typ eof data a var holds

for me
n = numberic data
s = sring data
b = logical boolean data
t = table
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 03:41:21 PM
Ok script contained a capitilazation typo .. that stopped it from working... Lua is every sensitive about that.
Title: Re: First script - Simple item mover
Post by: Superslayer on October 14, 2010, 04:17:49 PM
Picky about the operation case, yes? I saw somewhere that using the command 'lower' and 'upper' in string searching, you can ignore the case. I think it went something like:

local.lower

or

local.upper

maybe parentheses in it or bracket, ...so much to RE-learn!
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 04:36:01 PM
Picky about the operation case, yes? I saw somewhere that using the command 'lower' and 'upper' in string searching, you can ignore the case. I think it went something like:

local.lower

or

local.upper

maybe parentheses in it or bracket, ...so much to RE-learn!



But that doesnt help you when you make a Captilization typo in a varname... i had nContid instead of nContID   I editied the final posting to be correct.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 05:36:06 PM
Is this dependent on anything else? Like some other file needed to make it work??

It pops up a target cursor, doesn't say anything anywhere... I target my source, another target cursor pops, I target my dest, again there's absolutely no interaction. Then I target one of the items in the source and everything is moved.

Not exactly what I was looking for.
Title: Re: First script - Simple item mover
Post by: Cerveza on October 14, 2010, 05:44:51 PM
I got it. Had to rip Traegon's work because the simple task of

display ok Target this thing

Is too complicated to reproduce in OEUO. Now it's working.
Title: Re: First script - Simple item mover
Post by: Endless Night on October 14, 2010, 06:38:20 PM
lol arr yes .. good you got it .. he has given me permission to use his sub .. ill update that now so thiers less confusion.

Well i hope it helped you and others in some manner..
Title: Re: First script - Simple item mover
Post by: 12TimesOver on October 19, 2010, 07:52:19 AM
EN, great discussion. This kind of stuff helps me a lot and your write-up was easy to follow for me.

I'm finding a lot of structure similarities with vbscript so it's becoming less intimidating. Will start jumping in tonight I think and converting some of my standard subs.

Thanks!

X
Title: Re: First script - Simple item mover
Post by: Endless Night on October 19, 2010, 09:15:34 AM
EN, great discussion. This kind of stuff helps me a lot and your write-up was easy to follow for me.

I'm finding a lot of structure similarities with vbscript so it's becoming less intimidating. Will start jumping in tonight I think and converting some of my standard subs.

Thanks!

X

I can auto convert a script for you wont be 100% ...but you might learn even more from that as you will know what all the vars mean already and can focus on pure sysntax / structure
Title: Re: First script - Simple item mover
Post by: 12TimesOver on October 19, 2010, 09:25:16 AM
That could be interesting. How about "SuperStuff" from my Beta section? That is just a short series of random functions. Then maybe one of my trainers, say Cartography trainer?

X