ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: NecroFox on August 18, 2011, 09:01:19 AM

Title: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 09:01:19 AM
Hello,
this is my first scrip i have ever attempted to do. I know what i want it to do but i don't know how to set it up.
What i want it to do is:

Code: [Select]
Find fishing pole (code XHF)
Double click it
Click 2 titles infront of chr
wait 8s
Look for fish caught
if none found repeat
if found move fish to hold on new boat that is X 471 Y 310
then repeat
If shoe is caught then
drop on ground
then repeat
if mob is caught
say all guard me
then when dies look for MIB
if found MIB move to hold
then repeat
if no MIB found
repeat
if white pear is caught
then move to hold
then repeat
if that scale thing is caught
drop on ground
then repeat
after that is all checked then
check health
if damaged
Cast Greater Heal
Then repeat
if full health
Then repeat
Check my Vollem Health
if full
repeat
if dammaged
cast greater heal on it
then repeat
then say forward one
then start over again

That is what i want it to do I have no clue how to set it up to do all that can anyone help me?
Fish codes are:
SMZ TYZ EQD NMZ WYZ DQD OMZ RMZ GQD UYZ FQD ZYZ TYZ
White Pearl code
WWS
Where i want to tarket is
X 352
Y 382
My location
X 405
Y 315
Hold location is
X 471
Y 310
MIB Code
HTD (but thats that aquairm one i think they are the same)
That is what i want the script to do i just have no clue how to get it to do that
can anyone help me set it up?
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 09:22:50 AM
Just start breaking it down into code...

"Find fishing pole (code XHF)"

finditem XHF C_ , #backpackID ; find it in backpack

"Double click it"

set #lobjectID #findID ; sets last object to the last item found
event macro 17 ; uses last object

"Wait for target cursor"

target 3s ; you didn't have this but I know you want it

and just keep on going like that... test it with each part you add to make sure that part is working correctly.
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 10:28:32 AM
Ok running into a problem how do i select the ground in front of me?
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 11:00:33 AM
You need to know where you are. Then add/subtract to get to where you want to cast or target.

When testing try this... stand where you want to be and note your #charposX and #charposY. Then move to where you want to target and note the NEW #charposX and #charposY. Now look at the relationship between the sets of numbers. You'll see what you have to do....

And have a loot at ltargetKIND over at easyuo documentation.
Title: Re: My first scrip and need help seting it up
Post by: Guadah on August 18, 2011, 11:04:17 AM
This may or may not work, but it's where I would start.

Code: [Select]
set %xpos ( #charposx + 1 ) ; sets the variable %xpos as one spot north
set %ypos ( #charposy + 1 ) ; sets the variable %ypos as one spot east
set %target ( %xpos + %ypos ) ; sets the variable %target as one spot north and one spot east
set #ltargetid %target ; sets the last target as %target, which is one spot north, one spot east.
event macro 22 0 ; targets last target

Again, this is just a guess but is where I would start troubleshooting.
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 11:16:34 AM
You need to know where you are. Then add/subtract to get to where you want to cast or target.

When testing try this... stand where you want to be and note your #charposX and #charposY. Then move to where you want to target and note the NEW #charposX and #charposY. Now look at the relationship between the sets of numbers. You'll see what you have to do....

And have a loot at ltargetKIND over at easyuo documentation.

since i want to be moving in this script is there a way to do this

set  %Water #Charposx +2 #Charposy -1 #Charposz -7
so that as i change location it will keep choising the target infront my feet in the water?
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 11:21:56 AM
Almost, you have to remember when you set a variable it is setting A variable...

set %waterX ( #charposX + 2 )
set %waterY ( #charposY + 2 )

Then later when you want to click it....

click %waterX %waterY
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 11:22:49 AM
Tyvm I know i fill find more questions to ask as i go
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 11:27:46 AM
ok when i run it all it does is clicks pole and then dosent click the water the code so far is

Code: [Select]
;This script is my first one ever and i hope it is done correctly.
;If anyone knows how to make it flow better please help.
;I is supost to fish infrount of you then place fish, MIB and Pearls into hold
;Then move forward one. then repeat.

;Seting the different things
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
;Set %Scale to be added don't know code yet
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet TULKGF
Set %waterX ( #charposx -1 )
Set %waterY ( #charposy +2 )
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold

Finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17
click %waterX %waterY
wait 8s
Title: Re: My first scrip and need help seting it up
Post by: Guadah on August 18, 2011, 11:52:53 AM
You need to wait for your target curser to appear before you click.

Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #targcurs = true
      {
       wait 1
       }
click %waterX %waterY
wait 8s

Edit #1
After I submitted this I looked at what I wrote, and since you only have one line after the 'while #targcurs = true', you should be able to take out the { and } and have this:


Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #Targcurs = true
       wait 1
click %waterX %waterY
wait 8s

Which looks cleaner and has 2 less lines.  You'll appreciate the ability to shorten your scripts once you get one that goes over 1000 lines.

That is how I would look to work it.

Edit #2
Thinking post submit again.  You probably don't understand some of what is there.  After you have a statement like 'while blah blah blah' anything that is within the { and } will be what is performed until your 'while' statement comes true.

So if you set your '#targcurs = 1' that will give you a target curser.  Anything in the { and } will be performed until you target something to make it = 0.

So if you did:


Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #Targcurs = true
      {
       wait 1
       event macro 1 0 I love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       }
click %waterX %waterY
wait 8s

This will set your curser as 1, and while waiting for you to target it will pause 1 second, say "I love fishing..." and salute over and over and over until you target.  Now I don't recommend this, but you get the idea of what the purpose is.
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 12:07:34 PM
It is still just clicking the pole and not clicking the water it keeps the target hand up
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 12:08:57 PM
And have a loot at ltargetKIND over at easyuo documentation.

Have you done this already??

You need to set a last target....

set %ltargetX %waterX
set %ltargetY %waterY

event macro 22 ; last target

btw, I have an old sub that would work great for this, but would prefer you figure it out ;)
Title: Re: My first scrip and need help seting it up
Post by: Guadah on August 18, 2011, 12:14:15 PM
Going to be a little cryptic here, but I want you to think some, best way to learn!

#charposy + 2  (This is where your problem is.  Compare yours to what I wrote)

It's amazing what missing a space can do.  ALWAYS be careful about where you are putting, or not putting spaces, comma's and for that matter... any character.
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 12:35:09 PM
And have a loot at ltargetKIND over at easyuo documentation.



do what?
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 12:40:12 PM
i don't want to look at your fishing script but so far i have
Code: [Select]
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
Set %Scale UDHB_
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet1 TULKGF
Set %Pet2
Set %waterX ( #charposx - 2 )
Set %waterY ( #charposy + 2 )
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold


finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #targcurs = true
      {
       wait 1s
       event macro 1 0 love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       }
click %waterX %waterY
wait 8s
stop

it doesnt say the love fishing...
or the salute
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 01:33:53 PM
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold
Title: Re: My first scrip and need help seting it up
Post by: Endless Night on August 18, 2011, 01:54:39 PM
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 03:02:04 PM
You don't need to set the target cursor, when you use the pole it will automatically set to 1.

You just need to put the line

Target 3s

after the event macro 17 so the script waits till the target cursor comes up.
Title: Re: My first scrip and need help seting it up
Post by: Crome969 on August 18, 2011, 03:31:45 PM
You don't need to set the target cursor, when you use the pole it will automatically set to 1.

You just need to put the line

Target 3s

after the event macro 17 so the script waits till the target cursor comes up.
But Maximum will wait 3 Seconds.
if you want infinite waiting use Target
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 04:08:15 PM
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0

I have read what i think i was suppost to read what i read was

Drop Item on the Ground Around you  (non stacking)

Returns true or false for success or fail.  trys every spot around your character

Code: [Select]
Sub ENs_DropOnGround ; %itemid %BagFrom %DropRadius
  set %Item %1
  IF %0 <= 1
    set %2
  set %BagFrom %2
  IF %0 <= 2
    set %3 2
  set %DropRadius %3
 
  Set %XPos ( #CharPosX - %DropRadius )
  Set %YPos ( #CharPosY - %DropRadius )
  Set %DropExit #False
  Repeat
    wait 10
    FindItem %item C_ , %BagFrom
    wait 3
    If #FindKind = -1
      Set %DropExit #True
    IF %DropExit = #False
      {
      ;event ExMsg #charID 3 0 trying %xpos %ypos
      ExEvent Drag #findid #Findstack
      Wait 12
      ExEvent DropG %Xpos %YPos
   
      ; Increment Position
      Set %XPos ( %XPos + 1 )
      If %Xpos > ( #CharPosX + %DropRadius )
        {
        Set %YPos ( %YPos + 1 )
        Set %XPos ( #CharPosX - %DropRadius )
        }
      }
  Until %DropExit || %YPos > ( #CharPosY + %DropRadius )
Return %DropExit

but i do not understand it can someone explain how this works?
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 04:26:38 PM
I have figured out how to move items but i cannot figure out how to drop them where i want to drop them.
Also if there is more than one item i want to check for like i caught a fish and a pear i just have the script go though a line of checks?
And how do I search the ground for a dead monster then open it and search for an item?
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 18, 2011, 05:23:29 PM
look in the documentation for exevent drag and exevent dropc
Title: Re: My first scrip and need help seting it up
Post by: Endless Night on August 18, 2011, 05:34:05 PM
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0

I have read what i think i was suppost to read what i read was

Drop Item on the Ground Around you  (non stacking)

Returns true or false for success or fail.  trys every spot around your character

Code: [Select]
Sub ENs_DropOnGround ; %itemid %BagFrom %DropRadius
  set %Item %1
  IF %0 <= 1
    set %2
  set %BagFrom %2
  IF %0 <= 2
    set %3 2
  set %DropRadius %3
 
  Set %XPos ( #CharPosX - %DropRadius )
  Set %YPos ( #CharPosY - %DropRadius )
  Set %DropExit #False
  Repeat
    wait 10
    FindItem %item C_ , %BagFrom
    wait 3
    If #FindKind = -1
      Set %DropExit #True
    IF %DropExit = #False
      {
      ;event ExMsg #charID 3 0 trying %xpos %ypos
      ExEvent Drag #findid #Findstack
      Wait 12
      ExEvent DropG %Xpos %YPos
   
      ; Increment Position
      Set %XPos ( %XPos + 1 )
      If %Xpos > ( #CharPosX + %DropRadius )
        {
        Set %YPos ( %YPos + 1 )
        Set %XPos ( #CharPosX - %DropRadius )
        }
      }
  Until %DropExit || %YPos > ( #CharPosY + %DropRadius )
Return %DropExit

but i do not understand it can someone explain how this works?


Well if you wanted to drop on the ground sure... but you want to drop in the hold which like your backpack and bankbox is actually a containor

So a more appropriate sub would be the last one ENs MoveToContainor  >... But perhaps subs are to advanced for you at this stange in which case read up on exevent drag/drop like cerveza sugggested.

Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 18, 2011, 07:23:36 PM
Ok i have read both the event drag and exevent drop but i do not understand it. i took a pearl out of my hold and put it in my bag and made a new script so it will be easer to chang till it works then copy and past to the real one but all it does it just picks up the pearl and i still cannot get it to drop where the cargo hold is help please

Set %White_Pearl WWS_
Set %Cargo_Hold XZCC_

FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0
exevent drag #lobjectid
wait 20
exevent dropc %Cargo_Hold
Halt
Title: Re: My first scrip and need help seting it up
Post by: Crome969 on August 19, 2011, 12:09:22 AM
Code: [Select]
Finditem %Whitepearls C , #backpackID
;Find Items of Type\ID %Whitepearls in Container "BackpackID"
if #findkind <> -1
;If Searched ID\Types exist
{
;Open if Command and only will execute Code when the if is true
Exevent drag #findid #findstack
;Grab the foundet Result ID and the Amount of its Stack
wait 5
;This Command has a small Timeout given from Server
Exevent dropc %Cargo_Hold
;Let it fall down into a Container with name %Cargo_Hold
wait 5
;This Command has a small Timeout given from Server
}
;Close If Command
Under Each Line is outcommented Comments what the Line above do.About the waits: it doesnt matter if you wait after Drag & Drop or Drag wait Drop wait.But the Server has a timeout,if you interact faster it will block your action.
You must think about Easyuo interact as a Queue and a stupid robot.
when you making Code it will run from first until last line and will only do what u show him to.
If you want to let your robot grab something you must him show how he can find to get it,because when u say "Give me this" he dont know what is this and you must specific it.What he need to grab and how many\much of it and where to go to drop
Now about the Queue:
Some Commands have a specific "How to do Rule" to work succesfully.
Example:


Now we will analyze your Code:
Code: [Select]
FindItem %White_Pearl C_, #backpackID
;Trying to Scan for %White_Pearl in Container "BackpackID"
set #lobjectID #findID
;Sets a Lobject as #FindID, if your Scan find nothing you will have nothing in
if #FINDCNT > 0
;Oh cool an if Command
exevent drag #lobjectid
;Where is your Stack? with that he will drag and drop 1 item part by part. If you would have 200 Whitepearls it would loot only 1
wait 20
;Long wait but how you wait after drop?
exevent dropc %Cargo_Hold
;This is fine...
Halt

Hope it helps..

Crome
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 19, 2011, 12:14:42 AM
Ok well i figured it out
Now i need to learn how to get a script to check for the message to determan if i caught a fish, schale, shoe, serpant, pearl or a big fish
what should i read up on to get that infomation?
Title: Re: My first scrip and need help seting it up
Post by: Crome969 on August 19, 2011, 12:30:07 AM
Ok well i figured it out
Now i need to learn how to get a script to check for the message to determan if i caught a fish, schale, shoe, serpant, pearl or a big fish
what should i read up on to get that infomation?
You could try to scan the Journal and ask if %Message is in Journal" or you just could determine the Types of items u want stack in Boat in "List A" and determine Items you wanna throw in "List B"
than Scan for List A if something found drop it in your cargo else Scan for List B if something found drop on Ground. Easyiest way.

Crome
Title: Re: My first scrip and need help seting it up
Post by: camotbik on August 19, 2011, 12:50:55 AM
example for journal scan, it will loop until you get the message that you need or there has been a timeout(20s) .
Code: [Select]
set %timer_tame #sCnt
; --------------------
; do whatever you have to do before scaning journal
;---------------------
      set %_jindex #jindex ; this sets up the line to begin scan from
      set %exit #false
      set %timer_tame ( #sCnt + 20 )
      repeat
        {
          if #jindex >= %_jindex
          {
            scanjournal %_jindex
            if you_fail in #journal || seems_to_accept in #journal || too_far_away in #journal || anger in #journal || clear_path in #journal || #sCnt >= %timer_tame
              set %exit #TRUE
            set %_jindex %_jindex + 1
          }
          wait 0
        }
      until %exit #TRUE
; --------------------
; do whatever you have to do after journal scaning has been done
; --------------------
Title: Re: My first scrip and need help seting it up
Post by: Cerveza on August 19, 2011, 02:40:23 AM
Something you have to know about "condition" statements like if...

if something ; will execute either the very next line or everything inside {}

Code: [Select]
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0
exevent drag #lobjectid
wait 20
exevent dropc %Cargo_Hold
Halt

if #findCnt > 0 ; ok, if there are more then 0 of them execute THE NEXT LINE
; if there are 0 of them then SKIP THE NEXT LINE

see if you have 0 in your pack then it skips over the drag line and does the wait line. How about changing it to this:

FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0 ; if the condition is true perform the NEXT LINE or what's within the {}
{
exevent drag #lobjectid
exevent dropc %Cargo_Hold
wait 20 ; I arranged this for you
}
Halt ; if more then 0 then do the stuff in {}, if 0 is found then skip that and wind up here
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 19, 2011, 03:10:27 AM
i figured it out last night but the way i coded it looks different it looks like

Code: [Select]
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 19, 2011, 03:37:10 AM
the part i need to understand now is how do i look though my journal for the syntex to check if what i caught be it a monster a scale. a pearl, a fish. a big fish, or nothng?
Title: Re: My first scrip and need help seting it up
Post by: camotbik on August 19, 2011, 04:15:12 AM
Ok I will give you an example from my dungeon fisher. Maybe this way you will understand.
Code: [Select]
sub drop2
start:
  tile init
  tile cnt #ltargetx #ltargety
  for %i 1 #tilecnt
  {
    tile get #ltargetx #ltargety %i
    if water in #TILENAME || wet in #TILEFLAGS
    {
      if #TILETYPE = 6051 || #TILETYPE = 6063 || #TILETYPE = 6047 || #TILETYPE = 6048 || #TILETYPE = 171 || #TILETYPE = 170 || #TILETYPE = 168 || #TILETYPE = 6052 || #TILETYPE = 169 || #TILETYPE = 6039
        return 1
      set #LTARGETTILE #TILETYPE
      set #LTARGETKIND 3
      set #LTARGETZ #TILEZ
      finditem KDF C_ , #backpackid
      if #findcnt > 0
        set #lobjectid #findid
      else
        halt
      set #LTARGETKIND 3
      event macro 17
      target 2s
      event macro 22
      wait 10
      set %_jindex #jindex
      set %go #false
      set %maxtimeout #scnt2 + 20
      repeat
        if #scnt2 > %maxtimeout
        {
          return 1
        }
        if #jindex >= %_jindex
        {
          if ( #weight > ( #maxweight - 70 ) )
            return
          scanjournal %_jindex
          if pull in #journal || fail_to_catch in #journal || a_white in #journal
          {
            goto start
          }
          if seem_to_be in #journal || something_is_happening in #journal
          {
            return
          }
          if closer_to_the in #journal || target_cannot_be in #journal
          {
            return 1
          }
          if already_fishing in #journal
          {
            wait 5s
            goto start
          }
          set %_jindex %_jindex + 1
        }
        wait 0
      until %go = #true
    }
  }
return
Title: Re: My first scrip and need help seting it up
Post by: Crome969 on August 19, 2011, 04:48:01 AM
But why setting #LobjectID yet?
Its like fill a cup with water then fill that water in other cup then refill in first cup because u need first cup.
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 19, 2011, 03:20:38 PM
ok so i got all the subs i know how to do made and they work on their own when i test them
But how do i bring them together into a script that flows.
what happens when i doesnt work correctly when i run it as a whole.
I still dont know how to get a jurnal scan working but heres the code.

Code: [Select]
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
Set %Scale UDHB_
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet1 TULKGF
Set %Pet2 DADOJD
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold


finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
target 3s
If #targcurs = True
       wait 1s
       event macro 1 0 I love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       gosub TargetW
return

Sub TargetW
set #LTargetX #charposx - 2
set #LTargetY #charposy - 1
Set #LTargetKind 3
event Macro 22
wait 8s
gosub Check_Fish
wait 20
gosub Pearl
wait 20
gosub Shoes
wait 20
gosub Heal
wait 20
event marco 1 0 Forward one
return

Sub Heal
event macro 15 28
target
event macro 23 0
return

Sub Mob
event macro 1 0 Killer Guard Me
wait 10s


Sub Check_Fish
Finditem %FishType C_, #BackpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
return

Sub Shoes
FindItem %Shoes C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Pet2 G_4
exevent dropc #Findid
return

Sub Pearl
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
return

i think the problem is that i need to put in something that tells it to look for something before i go to the sub. is that my problem?
Title: Re: My first scrip and need help seting it up
Post by: camotbik on August 19, 2011, 03:59:00 PM
First of all, Crome and Cereveza showed you your problems!
Code: [Select]
if WHATEVER
{
CODE!
}
Second of all, take a look at tutorials, and download the EUO single page tutorial html( from easyuo.com ), to get the basics. with out them, you wont event get a script working. How the gurus say, rtfm. I would help you, but, if you dont try there is no point of doing that.
Title: Re: My first scrip and need help seting it up
Post by: Endless Night on August 19, 2011, 03:59:07 PM
bit a fixup  -- comments in the code

Code: [Select]
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
Set %Scale UDHB_
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet1 TULKGF
Set %Pet2 DADOJD
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold

repeat  ; do a block of code more than once finish at until
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
target 3s
If #targcurs = True
    {  ;  must have {} for blocks of code after an if
       wait 1s
       event macro 1 0 I love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       gosub TargetW
    {  ;  must have {} for blocks of code after an if
until #charghost = YES   ; end script when your a ghost.
Halt ;-- halt the script
; return  <-- return to where .. this is not part of a sub

Sub TargetW
set #LTargetX #charposx - 2
set #LTargetY #charposy - 1
Set #LTargetKind 3
event Macro 22
wait 8s
gosub Check_Fish
wait 20
gosub Pearl
wait 20
gosub Shoes
wait 20
gosub Heal
wait 20
event marco 1 0 Forward one
return

Sub Heal
event macro 15 28
target
event macro 23 0
return

Sub Mob
event macro 1 0 Killer Guard Me
wait 10s
return ; -- subs must end in return

Sub Check_Fish
Finditem %FishType C_, #BackpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
return

Sub Shoes
FindItem %Shoes C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Pet2 G_4
exevent dropc #Findid
return

Sub Pearl
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
return
Title: Re: My first scrip and need help seting it up
Post by: NecroFox on August 19, 2011, 07:21:42 PM
How would i scan the ground for a corsps?