Yoko

All sides of Injection
It is currently 2024-04-28 16:42:47

All times are UTC+02:00




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Info on yokoinjection
PostPosted: 2004-06-15 20:03:44 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
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 :( ) ?


Top
   
 Post subject:
PostPosted: 2004-06-15 22:23:01 
Offline

Joined: 2004-04-06 22:41:11
Posts: 80
1) try to use downcase names for varibles

2)no you cant

3)the english homepage with the changelog :|


Top
   
 Post subject:
PostPosted: 2004-06-15 23:11:11 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
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?


Top
   
 Post subject:
PostPosted: 2004-06-15 23:54:49 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
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?


Top
   
 Post subject:
PostPosted: 2004-06-16 00:46:57 
Offline

Joined: 2004-06-16 00:44:18
Posts: 56
Here is a sample of how to use arrays from one of my scripts.

Code:
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. :)


Top
   
 Post subject:
PostPosted: 2004-06-16 11:14:14 
Offline
Expert!

Joined: 2004-04-25 11:11:07
Posts: 359
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:
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....

_________________
Без труда не выловишь и рыбку из пруда,
А без пруда не выловишь её и с трудом...


Top
   
 Post subject:
PostPosted: 2004-06-16 12:53:00 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
oh thanks men :) that really rocks!
and for the "useskill" command? do you know something


Top
   
 Post subject:
PostPosted: 2004-06-16 15:09:48 
Offline
Expert!

Joined: 2004-04-25 11:11:07
Posts: 359
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

_________________
Без труда не выловишь и рыбку из пруда,

А без пруда не выловишь её и с трудом...


Top
   
 Post subject:
PostPosted: 2004-06-17 01:16:26 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
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 :D


Top
   
 Post subject:
PostPosted: 2004-06-17 16:51:28 
Offline
Expert!

Joined: 2004-04-25 11:11:07
Posts: 359
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

_________________
Без труда не выловишь и рыбку из пруда,

А без пруда не выловишь её и с трудом...


Top
   
 Post subject:
PostPosted: 2004-06-18 01:14:50 
Offline

Joined: 2004-06-15 19:29:25
Posts: 6
ok thanks :D


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 11 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 77 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited