Author Topic: help convert this sub from eoux to oeuo  (Read 7602 times)

0 Members and 1 Guest are viewing this topic.

Offline CstalkerTopic starter

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
help convert this sub from eoux to oeuo
« on: February 25, 2012, 08:20:55 PM »
0
here i go trying to learn this stuff and i keep getting stuck. It may be my way of thinking. maybe ya'll can help get my mind in the right direction.

This is one of my basic gosub (function now) that i used in euox

Code: [Select]
sub corpse
 If %1 = open
  {
    nextcpos 666 369
    wait 2
    set #lobjectid %CORPSE
    wait 2
    event macro 17 0
    wait 2
   }
  If %1 = close
   {
    set #lobjectid %CORPSE
    wait %vswait
    click 741 425 r
    wait %vswait
   }
Return

Now how would this convert over to OEUO? I am assuming that i will have to have another function that will handle finding the corpse, and that could be called from inside this function and  that is going to be another bag of worms to tackle. First i want to grasp this simple part.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: help convert this sub from eoux to oeuo
« Reply #1 on: February 25, 2012, 09:04:21 PM »
0
Its been a while since i jumped into lua but this would it be i think:
Code: [Select]
function Corpse(Status,CorpseID)
if Status == "open"
then
UO.NextCPosX = 666
UO.NextCPosY = 369
wait(100)
UO.LObjectID = CorpseID
wait(100)
UO.Macro(17,0)
wait(100)
end
if Status == "Close"
then
UO.LObjectID = CorpseID
wait(vswait)
UO.Click(741,525,false,true,true,false)
wait(vswait)
end
end
in lua you sending arguments via declaration.
so you have Corpse("Open",ID) in my example to do , to use this function.
As you maybe noticed i addet an ID in the Argument list. In your Example you have the function "Corpse" and the ID "Corpse". In lua we dont have the splitter like % , so Corpse would be Corpse. To avoid you could do 3 different ways:
  • Dont call the Scriptvariable Corpse
or
  • Call the function OpenCorpse
or
  • Use the function as i showed

Looking Command Overview or Variable Overview can be always pretty helpful
Crome
« Last Edit: February 25, 2012, 09:10:33 PM by Crome969 »

Offline CstalkerTopic starter

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: help convert this sub from eoux to oeuo
« Reply #2 on: February 25, 2012, 09:39:40 PM »
0
thank, i will explore this in the morning.

Oh one thing and i think it may click.

in euox i would use that by

gosub corpse open

 would i use it in oeuo like this

Corpse (open,CorpseID)
« Last Edit: February 25, 2012, 09:44:12 PM by Cstalker »

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: help convert this sub from eoux to oeuo
« Reply #3 on: February 25, 2012, 10:20:54 PM »
0
In lua arent Gosub or Gotos exist. just call functioname(arguments).

Offline CstalkerTopic starter

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: help convert this sub from eoux to oeuo
« Reply #4 on: February 25, 2012, 11:51:22 PM »
0
Code: [Select]
function Corpse(Status,CorpseID)
if Status == "open"
then
UO.NextCPosX = 666
UO.NextCPosY = 369
wait(100)
UO.LObjectID = CorpseID
wait(100)
UO.Macro(17,0)
wait(100)
end
if Status == "Close"
then
UO.LObjectID = CorpseID
wait(vswait)
UO.Click(741,525,false,true,true,false)
wait(vswait)
end
end

CorpseID=1107006339
Status=open

Corpse ()
[code\]

ok when i do this it does not trigger the open section of the function

i have tried
Corpse (open)
Corpse (open,CorpseID)
Corpse (Status,CorpseID)
and
Corpse (open,1107006339)

and none are triggering the open section. I step through it with the f7 so it is going.

I will keep at it and sooner or later i will get it.

or am i thinking all wrong. I read the example on easyuo site and still just not grasping it




Offline CstalkerTopic starter

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: help convert this sub from eoux to oeuo
« Reply #5 on: February 26, 2012, 12:19:07 AM »
0
ok, got it, i was not using the" " around open


corpse ("open", CorpseID)

Thanks again.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: help convert this sub from eoux to oeuo
« Reply #6 on: February 26, 2012, 01:44:18 AM »
0
ok, got it, i was not using the" " around open


corpse ("open", CorpseID)

Thanks again.
Without " it things that u using a variable or function. And when not filled open with something then it would return nil . Also sending nil and never would jump into the right parts.
Iam not sure any more if lua were case sensitive with strings. So better stay prepared to be sensitive:)

Offline CstalkerTopic starter

  • Google Slut
  • ScriptUO Beta Tester
  • ***
  • *
  • Posts: 179
  • Activity:
    0%
  • Reputation Power: 0
  • Cstalker has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: help convert this sub from eoux to oeuo
« Reply #7 on: February 26, 2012, 10:54:09 AM »
0
yes its still case sensitive, so Close is not the same as close.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: help convert this sub from eoux to oeuo
« Reply #8 on: February 26, 2012, 11:18:56 AM »
0
yes its still case sensitive, so Close is not the same as close.
You could do string.lower (stringvariable) at each called String. So you avoid casesentive at Strings because all will be lowerchar translated.

Tags: