Improvment

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Improvment

Post by Mazer »

how to make script end then i dont have pickaxe in backpack ? tryed few ways dosent work..

Code: Select all

sub minround()
VAR Kirka = '0x0E85'  ; pickaxe
VAR MaxVes = 430  ; weight +- 15
VAR TileNum = '-1'  ; DONT KNOW
VAR x, y, t, k
VAR MaxTime = 100   
VAR ms1 = "There is no ore"
VAR ms2 = "You can't use"
VAR ms3 = "You put "
VAR ms4 = "You loosen some rocks"
VAR ms5 = "location"
VAR ms6 = "Try mining"
VAR ms7 = "You can't see that"
VAR ms8 = "No item"
for y=-2 to 2
for x=-2 to 2
while not UO.Hidden()
UO.Warmode("0")
uo.print("Hiding")
UO.UseSkill("Hiding")
wait(4000)
wend
 k = 0
     repeat
        UO.DeleteJournal()
        t = UO.Timer()
        k = k + 1
        wait(300)
        UO.WaitTargetTile( TileNum, STR( UO.GetX() + x ), STR( UO.GetY() + y ), 0)
        UO.UseType( Kirka )
        repeat
           wait(100)
        until UO.InJournal(ms1) OR UO.InJournal(ms2) OR UO.InJournal(ms3) OR UO.InJournal(ms4) OR UO.InJournal(ms5) OR UO.InJournal(ms6) OR UO.InJournal(ms7) OR ((t +MaxTime) < UO.Timer())
        If UO.Weight > MaxVes Then
           UO.Print(" owerweight" )
           return
        Endif
     until ( NOT UO.InJournal(ms4) AND NOT UO.InJournal(ms3) OR (k > 10) )
  next
next
 uo.Print('End')
endsub
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

if not uo.count( Kirka ) then
   uo.print( "No pickaxe in backpack." )
   return false
endif
Last edited by Destruction on 2007-12-20 03:31:59, edited 1 time in total.
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

and there i should put that ? after uo.usetype( Kirka ) ? or .. ?
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

The code Destruction provided you means that if it finds no pickaxe in the backpack it would return false and STOP immediately.

So let us see where can we add this code in your macro and avoid it from cycling forever. The best way i see is to add here:

Code: Select all

repeat 
        UO.DeleteJournal()
        t = UO.Timer()
        k = k + 1
        wait(300)
        UO.WaitTargetTile( TileNum, STR( UO.GetX() + x ), STR( UO.GetY() + y ), 0)
        UO.UseType( Kirka )

We replace phrase uo.usetype(kirka) with this:

Code: Select all

if uo.count( Kirka ) then
   UO.UseType( Kirka )
else
   uo.print( "No pickaxe in backpack." )
   return false
endif
Last edited by CuHTpoH on 2007-12-20 02:58:56, edited 1 time in total.
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

thank you very much :) cant test now im working :) so il doo that later ;) and say you news but i think everything will be alright :)
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

"and say you news but i think everything will be alright"

What do you mean "you news"?
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

I mean:) now im busy and dont have UO :)
so i test that script then im back home :)
and i write is it ok
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

so if pickaxe is equiped then skript cant find it..
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

uo.objAtLayer( "Lhand" )
uo.objAtLayer( "Rhand" )
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

how can i use that ? :/
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

thats ok but there is no such command as Count.. ?
CuHTpoH
Posts: 287
Joined: 2007-11-01 19:09:30
Location: Moscow
Contact:

Post by CuHTpoH »

i'm sorry, another time i made a small mistake )))
fix phrase with
uo.count( Kirka )
**Выставляем отступы в скриптах*** ©Destruction
Feel the Power of Dark Side
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

CuHTpoH wrote:i'm sorry, another time i made a small mistake )))
fix phrase with
uo.count( Kirka )

thx
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Mazer
Posts: 125
Joined: 2007-11-13 00:39:14

Post by Mazer »

nevermind :) thank you for all this help.. everything working now i have another problem :) i discribed in other post :) if you might help me thanks.. :)
Post Reply