Page 1 of 1
Info on yokoinjection
Posted: 2004-06-15 20:03:44
by raptor
hi there.. i'd ask you some info about yokoinjection
1-does someone know how to use arrays?
i use a syntax like:
1 dim A[10]
2 A[5]="1"
but i get an "unhandled parser exception" or something like that on line 2
2-is the bar (with reagents hits and other info) customizable? can i add dexterity potions necro reagents and so on?
3-is there any kind of bible for yokoinjection with all functions/variables/commands use (in english.. i dont understand russian

) ?
Posted: 2004-06-15 22:23:01
by lalla521
1) try to use downcase names for varibles
2)no you cant
3)the english homepage with the changelog

Posted: 2004-06-15 23:11:11
by raptor
i solved the array one i had an old version of injection.dll
it's a shame for the bar
mmh the homepage doesnt contain the lastest version of injection like 4ZD :/
anyway..thanks for the answers =)
ah.. do you know how to poison a weapon that is an object type?
a friend of mine told me to do
uo.exec ("useskill poisoning poison objectname")
is this right?
Posted: 2004-06-15 23:54:49
by raptor
i was wrong.. the arrays problem remains
i cant use
dim z[5]
sub aaa()
z[1]=1
uo.print(str(z[1]))
end sub
i cant use a global variable.. :/ i must use
sub aaa()
dim z[5]
z[1]=1
uo.print(str(z[1]))
end sub
is there a method (like function parameters) to use global arrays?
Posted: 2004-06-16 00:46:57
by Boydon
Here is a sample of how to use arrays from one of my scripts.
Code: Select all
sub speechcolor()
var i,n
Dim A[12]
A[0] = 0x0003 ;Blu
A[1] = 0x0026 ;Red
A[2] = 0x0035 ;Yellow
A[3] = 0x000D ;Purple
A[4] = 0x00ad ;Green
A[5] = 0x0120 ;Brigh Blue
A[6] = 0x03c6 ;Bright Grey
A[7] = 0x0331 ;Dark Grey
A[8] = 0x002B ;Orange
A[9] = 0x0005 ;Bright Blue
A[10] = 0x0021 ;Bright Red
A[11] = 0x01a2 ;Purple
A[12] = 0x028d ;Dark Yellow
i = 750
Restart:
FOR n=0 TO 12
Uo.fontcolor(A[n])
Wait(i)
NEXT
goto Restart
end sub
It changes your speechcolor every "i" seconds.
Just for fun.

Posted: 2004-06-16 11:14:14
by Lord Ruslan Nightmare
There is no direct support for global arrays (and also for dynamic arrays) - but you can write simple set of functions to implement global (maybe - dynamic) arrays via global variables.
Smth like:
Code: Select all
sub InitArray(name)
uo.setglobal("array" + name,"1")
end sub
sub SetArraySize(name,size)
if uo.getglobal("array"+name) then
safecall uo.setglobal("sizearray"+name,val(size))
if fatalerror then
uo.print("Exception in SetArraySize, FatalError: " + FatalError + ". Possible reason - invalid size")
endif
else
uo.print("Error: no such array: " + name)
endif
end sub
sub SetArrayElement(name,ind,val)
if uo.getglobal("array"+name) and uo.getglobal("sizearray" + name) then
if uo.getglobal("sizearray"+name) > ind then
safecall uo.setglobal("elementarray"+name + str(ind),str(val))
if fatalerror then
uo.print("Exception in SetArrayElement, FatalError: " + FatalError + ". Possible reason - invalid index or value")
endif
endif
else
uo.print("Error: no such array: " +name+", or size = 0")
endif
end sub
sub GetArrayElement(name,ind)
var result
if uo.getglobal("array"+name) and uo.getglobal("sizearray" + name) then
if uo.getglobal("sizearray"+name) > ind then
result = safecall uo.getglobal("elementarray"+name + str(ind),str(val))
if fatalerror then
uo.print("Exception in GetArrayElement, FatalError: " + FatalError + ". Possible reason - invalid index")
else
return result
endif
endif
else
uo.print("Error: no such array: " +name+", or size = 0")
endif
end sub
Of course there is need some dispose functions and some enchantments in SetArraySize (and, of course, bugfixes

)) ) - but this must work....
Posted: 2004-06-16 12:53:00
by raptor
oh thanks men

that really rocks!
and for the "useskill" command? do you know something
Posted: 2004-06-16 15:09:48
by Lord Ruslan Nightmare
Don't understand, what are you talking about...
uo.useskill() - it is what you need?
I think, you should look at online-help on Yoko's homepage...Yes it is on russian, but nmes of functions and syntax - on english. Alphabetical list - rulez!
http://yoko.netroof.net/help/help.php?l ... dictionary
Posted: 2004-06-17 01:16:26
by raptor
ah! a complete function/command list isnt it?!?
lol that's great!
basically i need a command to poison my kryss

i think that
"uo.useskill poisoning kryss" would work great
there is also uo.poison but i dont know what is this :/
thanks really a lot

Posted: 2004-06-17 16:51:28
by Lord Ruslan Nightmare
i think, it must work:
uo.waittargetobject(obj1,obj2)
useskill("Poisoning")
where obj1 - poison potion, and obj2 - weapon
or obj1 - weapon and obj2 - poison...It's shard-specific
Posted: 2004-06-18 01:14:50
by raptor
ok thanks
