This function would help making full afk scripts easier. We would know how much gold our characters earn. We could transfer money to bankier much easier. It's very useful with dice script too. It's very important method.
Printable View
This function would help making full afk scripts easier. We would know how much gold our characters earn. We could transfer money to bankier much easier. It's very useful with dice script too. It's very important method.
There's actually no NPC proxy yet
DarkstaR will there be a NPC proxy implemented?
I'll probably add Self.Balance() natively and do all of the parsing internally.
Yeah you need to add a way to see world too huehueuheue
yeee waiting for Self.Balance() !
@DarkstaR
plss when
Until there is a solution, just add a balance variable to your script and enter it before you run. Subtract/add as you operate. Not optimal, but it is functional.
@DarkstaR
balance = &45E8E0;
balance from market option? husaheuhuehue
husaheuhuehue bump
bump?
Please dont bump this thread.
DarkstaR already nows about that.
Thanks
Ok, I will not bump this thread.
Come on just make Self.Balance(). That is few minute for you DarkstaR. We can not make full afk scripts without balance & market
You can do:
Self.Money counts the coins you have and math it by his value, similar to Self.Balance()Code:elseif (labelName == "CheckWithdraw") then
Walker.Stop()
if Self.Money() < maxAmount then
os.exit()
else
print("Enough Balance, continuing...")
end
Walker.Start()
Stop spamming plx
Self.Money() doesn't count gold in nested backpacks. Of course one could go through all bps and count all money, but it is much better and simplier to use Self.Balance . And if we want to check if we have enough money to withdraw, we are force to map starting balance of all characters and then count gold in nested backpacks and play with adding/substrackting and writing that value to file.
Well... there is still a way to do it. You can try to withdraw 10k several times until the money you have in your containers doesn't change. Then you can repeat the procedure with platinums and gold coins. Sounds insane but hey you still got a solution :D
lua code:elseif (labelName == "DepositGold") then
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
local withdrawManas = math.max(_MaxManas - Self.ItemCount(_ManaPotionID), 0)*_ManaCost
local withdrawThunders = math.max(_MaxThunders - Self.ItemCount(_ThundersID), 0)*_ThundersCost
local total = math.abs(withdrawManas + withdrawThunders)
if total >= 1 then
Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
end
local monny = math.max(Self.ItemCount(3031) + (Self.ItemCount(3035) * 100) + (Self.ItemCount(3043) * 10000))
if monny < total then
os.exit()
else
print("Enough Balance")
end
Walker.Start()
lua code:local monny = math.max(Self.ItemCount(3031) + (Self.ItemCount(3035) * 100) + (Self.ItemCount(3043) * 10000))
if monny < total then
os.exit()
else
print("Enough Balance")
end
Did it naaps, enjoy!
It won't work.
yeah, I know. But then, you wanna do a safe bank script. For x reasons you can fail withdrawing while still having money on bank, and then while u fail to withdraw you got an action to close bot if you didn't withdraw correctly. Boom, epic fail.
You see, this is why XenoBot isn't the biggest bot, always people coming up with 'solutions' that aren't the real solution for it.
I don't really see the big issue here...
Pretty simple to see wether you've talked to Bank NPC or not. Same with if you fail to withdraw a couple of times it might be rectified to close the bot. Instead of having a NPC proxy that makes it possible for people to empty your whole bank-roll in a simple obfuscated script.
/Stusse
You can empty someone's bank roll today... NPC proxy won't help or hurt in that matter.
I'd rather have NPC proxy than Self.Balance as it's obviously more versatile and allows specific error handling.
Right now you can detect if something went wrong and retry X times, but that's the limit.
With NPC proxy you could tell exactly what went wrong and how to correct the problem, or alert the user if you can't.
If someone is pushing you, you could start a trasher or constantly step back to your position.
If you have low funds, you can alert the user.
If you haven't completed a quest you can alert the user / find an alternate route
Specific error handling is a must for advanced scripts, obviously common scripters don't need this, but some of us do.
Of all the feature requests, this is the one I want the most.
If I am not mistaken 'Self.ItemCount(3031)' or 'Self.Money()' does not count money that is in nested containers (which are closed).
(My post below is not relevant to this thread.)
Additionally, you can do:
lua code:
Walker.ConditionalGoto((Self.DistanceFromPosition(x, y, z) <= 1), 'DepositGold', 'BeforeDeposit')
Also, your y & z coordinates were in the wrong locations. I hope these isn't seen as an offensive post but rather one that you, and whoever else sees it, can learn from. I like seeing Walker.ConditionalGoto being used instead of the method you posted, its less code and pretty simplified. :)
Dude, stop. Seriously. What does a position checker offers to a safe bank script? Not really much, you didn't get my point but whatever. You want me to help? Sure. This would've helped a lot more, if it was possible.
lua code:local minBankAmount = 10000 --example of gold on your bank to stop botting
if Self.Balance() < minBankAmount then
Walker.Stop()
end
Or another one, to read the NPC message ('There is not enough gold on your account.') and stop bot whenever a NPC says that.
I'll show another example below of why a variable to return your bank balance is useful too.
Well if you talk about cleaning someone's bank I'm sure I can obfuscate a code to deposit all gold, then keep withdrawing 10k until there's no more money, store the amount when it gets static, deposit all back and transfer that amount to my character. Won't take much to get cleaned. Also, to read NPC messages is a must. In fact, all kind of messages are a must. The only one that Darkstar did a great job on it was the orange message, no other bot can read it, but what about the others?
A function to check your balance helps not only on bank, but on market functions also. Oh wait, XenoBot doesn't have these too, but even if it was available, you would need to check your balance before buying x item or making a market offer for y item.
Once again, this bothers me much, lack of creativity not only from Darkstar to make his bot better and the users that got used to having so few functions/variables and having to deal with them or not knowing the power of different functions/variables.
Edit:
/\ THIS. Thanks, Syntax.
Not my problem actually but you gotta understand something. Xenobot is not for the lazy one. There were plenty of functions lacking in many of the previous versions but no dedicated scripter went all fuzzy. I do agree and I have said many times that Xenobot lacks stuff that other bots have. You must be really into this thing if you want things to be done your way. Advanced spell casters, several checks, performance issues, tracking creatures and a long list of things that have been fixed after every new version.
I have lived for years now with a simple check in banks and waiting patiently for new functions. It's more like... Really if you don't like the way it works you just migrate to another bot :p
If you have more ideas you should post them here (http://forums.xenobot.net/showthread...02-Suggestions) Unless you have already done that
NPC Proxy or we riot ;)