I'd like to write a pulverize-bot, but have no idea where to start...

j12601

New member
I guess this would be the right place to look for help...

After seeing a request on the forums for a pulverize-bot, I decided I would make one. I started leveling up a char (aptly named Crushinator), and then realized my scripting knowledge is...not so good.

I'm thinking I want it to

Essentially what I want the bot to do is:
1. keep track of any pulverizable items it receives
2. Pulverize that item or items
3. kmail back anything obtained by pulverizing

then, when receiving things which can be combined at the malus

1. keep track of what it received, if it is not equal to a multiple of five, keep track of that so it can return extras.
2. use the malus only up to the next level (so if it was sent 25 spooky powders, it would make 5 spooky nuggets, and send them back, not make 1 wad)


I'm thinking that this would use some mechanics similar to a buffbot (keeping track of things like received items and the results of smashing, and who sent what, etc.), so are there any buffbot scripts I should be looking at to get an idea on how exactly to do this? Some help would be appreciated if offered, but I'm not looking for someone to just write the thing for me. I'd actually like to learn a little scripting, so having a few key scripts to look over would be helpful.
 

Nightmist

Member
Well I think you might want to have a look at the trade response scripts rather then buffbot scripts, as the "buffbot module" is pretty much in-built into mafia so it won't generally teach you about parsing K-mails using ASH (well neither will the trade response scripts but at-least with them you can see "how" to parse a page in ASH). Unless someone actually wrote a ASH script to "replace" the in-built buffbot module... I wouldn't be surprised, control freaks =P.

Oh and you might want to remember to set your Kmail's per page thing to show 100 (thats the highest?) per page, rather then having to parse 5 different pages of 20 Kmails you can just parse a single page of 100. (Although I'm not sure howmuch performance increase this will do it does make more sense when you think about, "Hammer the server 5 times and have to wait for it to reply each time and then parse at lightning speed" or a "Hit the server once and then just parse that all at lightning speed")

You could possibly use the same concept as the buffbot module where it does each request at a single time, or you could attempt to parse it all into a single map before doing stuff (So multiple requests with the same item for pulverizing can just be "grouped" into a single pulverize and just send that total back, although that could spark some confusion although that situation probably wouldn't occur anyway and the possible confusion might be too much hassle to do it that way)

Personally though I don't see why a pulverise bot is needed really since you can just perm the skill and then the only requirement is being either of the muscle classes. Buff-bots are pretty much guaranteed to be "cheaper" since they have more efficient MP restores so they have what I think is a valid reason for having them but for pulverise, it doesn't exactly take the years (literally) of powerleveling like the buffbots to get a equal "deal".

Note: I probably won't be personally working on this script since I have no "personal gain" in doing so. (I actually based my trade response script on//for the 'Bone Depot' since I thought it would be quite the interesting project and a working TradeBot that is easily edited for various trades is quite useful) plus everytime I add new "Automated-Bot Scripts" I get the weird feeling that some people that wouldn't usually run this type of bot would just go: "Ooh easy way to make my clan look cooler by having a X bot! Lets randomly make a new character and have it hammer the sever every minute because I don't know how to use the 'wait' command."
 

j12601

New member
I'm with you on the "why is this kind of bot needed" thing.
The skill took me a whopping 4 days to obtain in normal...and that was my 14th or so skill. (Buring up clovers can get the skill rather quickly...I would have had it 3 days with 20 more adventures or better planning.)

The only good use I can really see for such a bot existing would be that you come out of ronin and want to craft up a big ol' mess of meins for your next few runs but all you have are piles of powders. You send the powders to the bot, it sends back your nuggets.

Although, if you're out of ronin and in a crafting mood, chances are you might know someone else out of ronin who could do it for you, or you could just buy nuggets in the mall (which I currently do when I run out on a craft-fest), they're not very expensive.

Guess I'll look at some script stuff and figure out if it's really worth it to me to actually try and put this together.
 
You may want to try Fnord7's KolBot library for this bot. Esspecially since you will probably need some sort of DB. It is written in Perl but it is pretty self-explanitory and their are alot of knowedgeable users that can help you!
 
I would start with the pulverising part first. Set up a function which pulverises items using visit_url, and reads the html response to determine what items it recieved. initial debug code would be to print the items to the gcli so you could manually check against your new inventory contents. once functioning remove the debug code.

Next I would set up a k-mail parsing function. This function would read each k-mail one at a time, and store items recieved in a variable. It would also retrieve the player name/number for later use. again debug print statements are a big help. Remove them when the function is working properly.

next the 2 functions need to act with each other. execute k-mail parsing, then based on the results smash items.

finally, the returning of the smashed items to the player who sent items to be smashed.

that would cover the smashing part, now for combining powders to wads you would only need to expand what you have to handle combining which will prove easy.

once all that is working in a script the only thing left to do is to set the whole process into an infinite loop. be sure you set up an appropriate wait command so as not to hit the servers too many times. wait 120 should be fair enough, but if this bot is only slightly used then wait 300 might be more feasible.

Oh I almost forgot you have adventures to burn so you'll need to add the killing of your adv in the clan gym or basement diving. I mean this is a bot right? A bot that would have no use for meat at all.
 

Nightmist

Member
Oh and when your Kmail parsing, don't forget to find a method of separating the "Kmail Message" and the "Kmail Items" sections. You don't want someone sending you "fake" items >>. Since if you realease this script then anyone can read what strings the script is using to parse the message. (Which is why I didn't mind giving out the trade parser because it has the trade note after the items so I can just end the items gained section when the note sections starts. Not too sure about Kmails, haven't looked at the html of them for ages)
 
Top