KoL Happy Meals

JosyJoker

New member
Hey Guys.. Josy here...

Me and Allison05_ from The Stronghold of Bubbles reside in /games as per normal. We want to make KoL Happymeat bot where any player can send a mall amount of meat to a character and the charater will send them back 3 items of food.

Now, you problem lies in that we dont have any scripting experiance. I have some knowladge of the mafia (I use it to burn adventures when I'm struck for time).

Could anybody provide us with some info on what we need?

All help will be appreciated. We want to make the KoL communaty a happier and fuller one. :eek:
 

JosyJoker

New member
holatuwol,

Thanks for the reply. Would you be able to point me in the direction on where I would be able to find one?
 

macman104

Member
Search for scripts that have to do with kmail, or trading. Some people have written some "trade response" scripts. You're gonna need a pretty solid handle on string handling and the visit_url and some other functions of the ASH language.
 
First you need to get the html response from messages.php

Next I would remove everything before the first instance of:
PHP:
<tr><td valign=top><input type=checkbox name="sel

and remove everything after the last instance of
PHP:
<tr><td align=center valign=bottom><a href="javascript:toggleall();">

Then I would use string [int] split_string( string source, string regex ) to split the messages apart. Probably at:
PHP:
</blockquote></td></tr>

following that I would I would pass each string returned by string split_string to the function int extract_meat( string text ) to determine if a valid amount was sent. If so, then I would use the send command to reply to the message. If it were desirable, maybe use int [item] extract_items( string text ) to check for items, and send a "happy meal" for specific recieved items?

More extensive would be a daily limit? I would probably use a map for that, but it would need added after some testing was done on the rest.

Finally should the script require manual execution each time to send the replies, or should it be an infinite looping script with a delay between checks? If you want a looping script the loop should be added last once all the rest has been thoroughly debugged.
 
Top