Author Topic: My first scrip and need help seting it up  (Read 11200 times)

0 Members and 1 Guest are viewing this topic.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #30 on: August 19, 2011, 03:37:10 AM »
0
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?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: My first scrip and need help seting it up
« Reply #31 on: August 19, 2011, 04:15:12 AM »
0
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
What you witness -- is whatver..
uogamers hybrid.

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: My first scrip and need help seting it up
« Reply #32 on: August 19, 2011, 04:48:01 AM »
0
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.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #33 on: August 19, 2011, 03:20:38 PM »
0
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?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: My first scrip and need help seting it up
« Reply #34 on: August 19, 2011, 03:59:00 PM »
0
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.
« Last Edit: August 19, 2011, 04:04:22 PM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: My first scrip and need help seting it up
« Reply #35 on: August 19, 2011, 03:59:07 PM »
0
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
« Last Edit: August 19, 2011, 04:00:44 PM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #36 on: August 19, 2011, 07:21:42 PM »
0
How would i scan the ground for a corsps?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Tags: