Page 1 of 1

HI, once again i need ur help :(

Posted: 2008-06-11 02:53:19
by Sumomo
hi guys!

this time i am trying to raise an animal tamer...so i would to write a script that use an array DIM animals[10]

animals[0]='0x817433'
.
.
.
animals[10]='someIDwhocares>.<'
so i can automaticaly switch from an animal to another one if i succesfully tamed the animal or repeat the taming action on the same animal if i miss to tame him!!!
i tryed to write it by myself first using for cycle and than while cycle
but i am still a noob scripter and i dunno where i miss cause after the first cycle the character does not do any other action (but the script is currently running :/ )

this is what i have done :
(i tested it with 2 animals)

Code: Select all

sub main()
   var i=0
   var j=2

DIM ani2[2]
ani2[0]='0x0026FCB7'
ani2[1]='0x0020E041'
while true

 uo.useskill("Animal Taming",ani2[i])
 Repeat
 wait(100)
 Until not UO.InJournal("it seems to accepts you") and not UO.InJournal("you faild to tame the animal")    #the word on my server r different but i thought it was better to translate it so you can understand ^^'
 
if uo.injournal("accepts")then
        uo.say("all release")
            i=i+1
           
       endif

if uo.injournal("faild")then
 
            i=i-1  #i tryed many time even using a uo.print("something") but the script does not make any action when i write "faild" in game
               
       endif

   wend

end sub


i know that i am messing something but i could not realize what is it!
i tryed many form of scripts but nothimg worked>_>

tnks for everything!

Posted: 2008-06-11 11:53:48
by Infectous
a mass if wants to run through all the arrays each time it is ran...

example:

Code: Select all

sub killbird()
var i
DIM t[9]
t[0] = "0x0005" ; eagle
t[1] = "0x0006" ; bird
t[2] = "0x00D0" ; chicken
t[3] = "0x00E7" ; cow
t[4] = "0x00D8" ; cow
t[5] = "0x00CF" ; sheep
t[6] = "0x00ED" ; hind
t[7] = "0x00EA" ; hart
t[8] = "0x00D1" ; goat
for i = 0 to 8
uo.findtype(t[i],-1,"ground")
if uo.findcount() then
uo.attack("finditem")
else
uo.print("wtf you looking at?")
endif
next
end sub


it looks for them all & tries to attack every one of them if more then one are found lol, which is ok when you wanna kill them all... now that I look at it I could put a return in there proceed to kill... that will be a different lesson

run this with nothing around you will get
wtf you looking at?
wtf you looking at?
wtf you looking at?
wtf you looking at?
wtf you looking at?
wtf you looking at?
wtf you looking at?
wtf you looking at?

any way to rethink your taming strategy... if simply to find any and all running around the forest use the above format or the 3rd one here it works with laststatus. Last shard I was on you could tame sheep to GM so I filled a room with 30 sheep and used "uomacro - targetnext"... then I got carried away & though wth may as well shear em while I was afk

note this is a 2 parter the second part is set to a hot key for on the run manual taming... not quite what I want it to do but I am always learning too & really don't tame that much so it's not quite finished but it gets the job done

Code: Select all

sub Taming()
Uo.Exec("set finddistance 5")
deletejournal(uo.getname('self')+": stop")
While not uo.injournal(uo.getname('self')+": stop")
Uo.Press(187) ;next Target
Wait(500)
tame()
wait(1000)
if uo.injournal("It seems|already tame") then
Uo.msg("all release")
end if
deletejournal("You can't|own master")
uo.waittargetobject('laststatus')
uo.useskill('Animal Lore')
repeat
wait(100)
until uo.injournal("You can't|own master")
uo.findtype('0x00CF','-1','ground')
while uo.findcount() >= 1 and uo.getdistance('finditem') <=4
repeat
if uo.getdistance('finditem') > 2 then
WalkN(0,0,'finditem')
else
uo.waittargetobject('finditem')
uo.useobject('cleaver')
wait(1000)
endif
uo.findtype('0x00CF','-1','ground')
until uo.findcount() == 0
WalkN(2513,84,'')
wend
uo.usefromground('carrots')
wend
end sub

hotkey

Code: Select all

sub tame()
var retry = "You fail to tame the"
var end = "You can't tame them.|cannot be|remembers you and|It seems to accept you as|You are too far|You can not see the creature.|You are your own|You give up|do that while|You cannot tame that|You are preoccupied|is already tame|Thou hast tamed "+uo.getname('Animal')
deletejournal(end)

uo.waittargetobject('laststatus')
UO.addobject('Animal')
uo.getname('Animal')

while NOT uo.injournal(end)
if uo.warmode('1') OR uo.injournal("You are preoccupied|You give up") then
deletejournal("You are preoccupied|You give up")
uo.print('get out of war mode')
repeat
wait(100)
until uo.warmode()==0 AND uo.life>=uo.str-10
endif
deletejournal(end)
deletejournal(retry)
uo.waittargetobject('Animal')
wait (100)
uo.useskill ("Taming")
repeat
wait (200)
until uo.injournal(end) or uo.injournal(retry)
wend
endsub


note: I use addobject cleaver for my sword type wep to shear the sheep
my "=" button is targetnext (in uo ingame options macros key=187)
and ,addtype carrots on the ground to eat
also this is a newer server so some messages may not apply or may need to be edited for yours

sorry for the mess but I think you will get the idea, I don't tame that much anymore so what is done is done till I move to a new server :P

if "function not found" simply search yokoforums for the function ex the walkn & deletejournal good luck & hope it helps

Posted: 2008-06-16 15:07:58
by Sumomo
yes tnk you i did a nice script tnks to your advice! :D

tnks again! :wink: