View Full Version : Variables and functions between dollar symbols
I've decided to try to make a list of what all of the variables are used for, or atleast those of them that I know how to use. I'll take them in the order they're listed, ignoring those that I don't know how to use.
The events are used in the Exiva EXP message, the "show EXP in Title" text, and in certain cavebot scripts.
There are two types of returns. Strings and numbers. I'm not sure what events that returns what, so you'll have to experiment a bit. As far as I know, all values are only numbers unless otherwise is written.
Whatever the type of the return, they can all be used with "sayMessage" in the cavebot or as actions in the cond. events. The difference is that you can do math with numbers but not with strings.
$expleft$
Pretty easy, this one returns the amount of EXP left to the next level.
$nextlevel$
Returns what your next level is.
$exph$
Returns the amount of EXP you get each hour.
$timeleft$
Returns the time left for the next level at the current EXP/h rate.
$played$
Returns how long you have been online. (I believe this is only a string)
$expgained$
EXP gained since you logged in.
$charactername$
Returns your charactername. String.
$lastsender$
Returns the name of the character that last said something to you, I believe this is only for default and PMs tho. String.
$lastmsg$
Returns the last message recieved, I believe this also is only for default and PMs. Useful when talking to NPCs; example:
IfTrue ($lastmsg$#string=#Hiho $charactername$.) Goto $nlineoflabel:label$
This would only become true if the NPC said "Hiho" followed by the name of your current character.
$myhp$
Returns the current amount of HP.
$myhppercent$
Returns the current amount of HP in percent.
$mymana$
Returns the current amount of mana.
$mylevel$
Returns your current level.
$mysoulpoints$
Returns your current amount of soul points.
$myexp$
Returns your current amount of EXP.
$lastpkname$
Returns the name of the monster or player that attacked you that was not on the runemaker friend list or in the cavebot's kill list. String.
$lastgmname$
Returns the name of the last GM seen. String.
$date$
Returns the current date in DD-MM-YYYY. Only string I believe.
$time$
Returns current time in HH:MM:SS. Only string I believe.
$shorttime$
Returns current time in HH:MM. This might be both string and number.
$mycap$
Returns your current cap.
$mystamina$
Returns current stamina in minutes.
$randomlineof:*.txt$
Returns a random line of the textfile named *. Needs to be saved in the "randline" folder of BlackD Proxy. Useful for answering players/GMs.
$nlineoflabel:labelname$
Returns what line the label "labelname" is on. Useful when using "IfTrues" in the cavebot.
$hex-equiped-item:01$
The hex of the item equipped in slot 01. The slots are:
01: Head
02: Necklace
03: Backpack
04: Armor
05: Shield
06:Weapon
07: Legs
08: Boots
09: Ring
0A: Ammo
Useful when creating custom hexes for moving items to/from the EQ slots.
$hex-equiped-ammount:01$
Returns the amount, in hex, of items equipped in the specified slot. Same use as above.
$num-equiped-ammount:01$
Returns a numerical value on the amount of equipped items in the specified slot.
$hex-tibiastr:*$
Returns what the hex of the text * is.
$numbertohex1:*$
Returns what the number * is in hex. Can only count to 255.
$numbertohex2:*$
Same as above, but can count to 65535.
$hex1tonumber:**$
Returns what the hex of * is. Largest hex is FF.
$hex2tonumber:** **$
Returns what the hex of ** ** is. Must be four letters with a space in the middle. Largest hex is FF FF.
$numericalexp:A(+ - / *)B$
Returns what the value of A plus, minus, divided by or mulitplied by B is. Other events can be used by replacing A and/or B with {$event$}. You can use several numericalexp in the same calculation, but be sure to have enough $'s and {}.
$myx$, $myy$ and $myz$
Returns your current X, Y and Z coordinates. Remember that they are always used in this order in the cavebot and when sending hexes.
$comboorder$
Returns what the current order to use a combo is.
$comboleader$
Returns who the current combo leader is.
$pksonrelativefloor:0$
Returns the amount of players, NPCs and creatures currently detected at your floor. It only detects beings that are not on the friend list or the kill list. Change the zero to -* to see * floors below you, or number greater than zero to see floors above. Remember that it can not detect above or below if that floor is the "ground" floor, 7.
$gmsonrelativefloor:0$
Same as above, but only detects GMs.
$pksandgmsonrelativefloor:0$
Returns the amount of both GMs and "PKs".
$statusbit:*$
Returns 0 if you are not affected by status *, or 1 if you are.
Poison: 8
Attack sign: 1
Paralyze: 3
$_customvariable$
Creates a variable that returns whatever is specified in it. You create it by saying "exiva _customvariable = *" or in the cavebot using either sayMessage or fastExiva, where * is what the value should be. Maybe a numericalexp?
$__customglobalvariable$
Same as above, but this variable can be used and edited by all currently logged in characters. There are pretty few uses for this variable, for an example check out the follower script in my signature.
Please post here or PM me if you find any errors or have a better explanation. Also post here if you know what all the missing variables are for.
I hope this is useful for someone. :)
Thank you. :)
I was kinda suprised that noone has done this before tho, or atleast I haven't seen it.
Eliteknight
07-28-2007, 20:33
rly nice are them all ? i would want to know more.. and maybe some nice person make a new thread with uses of some that are uncommon for most ussers
rly nice are them all ? i would want to know more.. and maybe some nice person make a new thread with uses of some that are uncommon for most ussers
Try checking out some of mine and some of weeper's works and you'll get some ideas. I usually get my ideas by thinking of something I want done as automatically as possible, and then I try to create a script that does just that. Sometime it works, sometimes it doesn't.
Thanks Malmis,
your guide is very nice, and I didn't found any important error there in a first look.
This whas needing :) thanks, now maybe even the "no exp scripters" can understand 50% o the script they download? :P
This whas needing :) thanks, now maybe even the "no exp scripters" can understand 50% o the script they download? :P
Yeah, hopefully. :)
But even some experienced users complain about my scripts sometimes :p dragoon says they're too complex and weeper sometimes complains about there being to much math. :eek:
Realy nice job, i could sugest to explain some functions to script,
eg.:
useitem xx,xx,xx,
onDangerGoto
Regards
Byanex
Realy nice job, i could sugest to explain some functions to script,
eg.:
useitem xx,xx,xx,
onDangerGoto
Regards
Byanex
http://www.blackdtools.net/showthread.php?t=594 :)
i wanted to put on tibia window title a Profit thing for instance
Profit $countitems:27 0D$+($countitems:AB CD$*25)-($countitems:"empty vials"$*50)
i dont know if you understand what i mean but it would basicly show a value like 3350
wich would be the result of the math i put there.
is this possible?
i wanted to put on tibia window title a Profit thing for instance
Profit $countitems:27 0D$+($countitems:AB CD$*25)-($countitems:"empty vials"$*50)
i dont know if you understand what i mean but it would basicly show a value like 3350
wich would be the result of the math i put there.
is this possible?
Yes, but you would have to have all the backpacks with vials opened.
i've got a big screen they fit if minimized.
how could i do this?
i've got a big screen they fit if minimized.
how could i do this?
$numericalexp:{$numericalexp:{$numericalexp:{$coun titems:27 0D$}+{$countitems:AB CD$}*25$}$}-{$numericalexp:{$countitems:3A 0B 00$}*50$}$
That should be it.
thanks ill test it
tested it said 0
ill try the same thing in other ways or see if you forgot any"}"
Profit: $numericalexp:{$numericalexp:{$countitems:27 0D$}*{66}$}+{$countitems:D7 0B$ }$
so far i got this and its doing ok i cant seem to effectively - the mf cost
fastExiva > 78 FF FF 0A 00 00 $hex-equiped-item:0A$ 00 FF FF 06 00 00
$hex-equiped-ammount:0A$
fastExiva > 78 FF FF 40 00 00 D2 1C 00 FF FF 06 00 00 $numbertohex1:100$
can someone cut it in parts and explain each one? :P
also i saw some event called "sum" wtf is that? <.<
IfTrue ($_sum$#number<#0) Goto $nlineoflabel:withdraw$
fastExiva > 78 FF FF 0A 00 00 $hex-equiped-item:0A$ 00 FF FF 06 00 00
$hex-equiped-ammount:0A$
fastExiva > 78 FF FF 40 00 00 D2 1C 00 FF FF 06 00 00 $numbertohex1:100$
can someone cut it in parts and explain each one? :P
also i saw some event called "sum" wtf is that? <.<
IfTrue ($_sum$#number<#0) Goto $nlineoflabel:withdraw$
All variables starting with an underscore is a custom variable.
Also those are hexes to move stuff.
Krix_and
07-17-2008, 00:06
$pksandgmsonrelativefloor:0$ tells u the number from whole FLOOR
what i must do to dedect onli on screen?
i wnat to meke alert event
if gm or pk on scren do exive testding
is it possible?
IfTrue ($randomlineof:npcs*.txt$#String:NPCNAME$.) Goto $nlineoflabel:Z$
Please send me msg this are correct or no thx.
gutodrcn
08-10-2008, 09:51
$randomlineof:*.txt$
Returns a random line of the textfile named *. Needs to be saved in the "randline" folder of BlackD Proxy. Useful for answering players/GMs.
Is there any way to return a certain line of a textfile?
Not random I mean.
Really nice. it helps me alot with conds
;p
Thanks, Really thanks
cya ;D
Sztuczny
09-12-2013, 02:04
Is there anything like:
If(target hp percent > 80) say: SPELL NAME
??
I'd like to have something like this to avoid wasting my mana on "almost deads"
thanks in advance ;)
Powered by vBulletin® Version 4.2.5 Copyright © 2021 vBulletin Solutions Inc. All rights reserved.