Now for buying items
So, you have to get a bit of information for this section.
Mana ID's:
Mana Potion = 0C 01
Strong Mana Potion = ED 00
Great Mana Potion = EE 00
Mana Costs
Mana Potion = 50
Strong Mana Potion = 80
Great Mana Potion = 120
First you will need the item ID's. For this script I will highlight the ID's in red, along side some other variables (optional bits) I will be using strong mana potions for this example. Obviously this works for health potions as well, not sure on Paladin items yet I will experiment and get back to you on that, but heres this for now:
At the start of your script you will put this:
Code:
fastExiva _manapotionid = ED 00
# How many manas do you have?
fastExiva _manas = 300
# How much does 1 potion cost? MP = 50, SMP = 80, GMP = 120
fastExiva _idcost = 80
This basically tells the script which mana potion you will use.
This snippet should be just before the first WPT, edit the red number to change the amount of manas you should buy more on. This then counts the manas left, and takes your char to the 'REFILL' line if you need more.
Code:
IfTrue ($countitems:{$_manapotionid$}$#number<#45) Goto $nlineoflabel:refill$
You should then put in this line after your main WPT's.
Code:
gotoscriptline 0
:refill
This shows the bot that this line is the 'REFILL' line, where the script fills up manas. After this line you should put in your WPT's to the banker, so you can deposit gold and withdraw enough for your mana potions. You will need to set up the depositer to withdraw a certain amount of gold, as you need it. This line does this for you, and withdraws it.
Code:
fastExiva _mana = $numericalexp:{$_manas$}-{$countitems:{$_manapotionid$}$}$
fastExiva _manacost = $numericalexp:{$_mana$}*{$_idcost$}$
saymessage hi
waitX 2
fastExiva > 96 04 $hex-tibiastr:deposit all$
waitX 1
fastExiva > 96 04 $hex-tibiastr:yes$
waitx 1
sayInTrade withdraw $_manacost$
waitX 1
fastExiva > 96 04 $hex-tibiastr:yes$
waitx 1
Now, to go buy the manas you will put next the waypoints from the banker to the mana potion shop, then the follow code.
Code:
saymessage hi
waitx 2
fastExiva > 96 04 $hex-tibiastr:vial$
waitx 2
fastExiva > 96 04 $hex-tibiastr:yes$
waitx 1
fastExiva > 96 04 $hex-tibiastr:yes$
fastExiva > 96 04 $hex-tibiastr:yes$
waitx 2
fastExiva > 96 04 $hex-tibiastr:trade$
waitx 2
fastExiva > 07 00 7A $_manapotionid$ 00 $numbertohex2:{$numericalexp:{$_mana$}/4$}$ 00
fastExiva > 07 00 7A $_manapotionid$ 00 $numbertohex2:{$numericalexp:{$_mana$}/4$}$ 00
fastExiva > 07 00 7A $_manapotionid$ 00 $numbertohex2:{$numericalexp:{$_mana$}/4$}$ 00
fastExiva > 07 00 7A $_manapotionid$ 00 $numbertohex2:{$numericalexp:{$_mana$}/4$}$ 00
waitx 1
That just basically buys the manas. It does leave a bit of Gold left, as it sells the vials.
After this just enter your waypoints back to the cave (first waypoint) and put in