Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Injection: Passing a parameter into a function?
#1

Does anyone know how I would pass a value into my function using ,exec / a hotkey? My goal here is to have one set of functions to handle casting instead of one for scrolls and a copy for normal casting.

Also, I'm not sure if boolean values even exist in injection's script?

Code:
sub greaterHeal_self(useScroll)
    uo.waittargetself();

    if uo.count(scroll_greater_heal) > 0 AND useScroll = true then
        uo.usetype(scroll_greater_heal);
    else
        uo.cast("Greater Heal");
    endif
end sub
#2

I'd like to know this too. I experimented a bit but was unable to use ,exec testfunction(param) command. Don't think there's a boolean datatype. Only thing I found was this bit about expression evaluation:

- IF-THEN condition. You can use "<",">","<=",">=","==","<>" to check if
one value is less then other. Use "AND", "OR", "NOT" in boolean expressions.
You cn use "&&" instead of "AND" and "||" instead of "OR". The zero value is
considered FALSE, the non-zero is TRUE.
#3

Cana Wrote:I'd like to know this too. I experimented a bit but was unable to use ,exec testfunction(param) command. Don't think there's a boolean datatype. Only thing I found was this bit about expression evaluation:

- IF-THEN condition. You can use "<",">","<=",">=","==","<>" to check if
one value is less then other. Use "AND", "OR", "NOT" in boolean expressions.
You cn use "&&" instead of "AND" and "||" instead of "OR". The zero value is
considered FALSE, the non-zero is TRUE.

if this is true then the zero value and non zero value works like a boolean...
#4

Raziel_ Wrote:if this is true then the zero value and non zero value works like a boolean...

Yes, sort of. If anyone is looking for more information some can be found here. It's not complete by any means but the text file (scripting.txt) can get you started.
#5

Just thinking outside the box here, but you could make a boolean variable using conditionals for ingame items. Like checking the itemid of a lantern that is turned on or off, then using the lantern to change the value.


Forum Jump:


Users browsing this thread: 1 Guest(s)