Request of bot script with a reward :D

blue

Member
OK well I would need a script for KoL Mafias latest version.

The reward is a yuletide troll or a katana (the IOTM).

I have allready seen a bot that respondes to trades, one that puts everything in the mall and one that reprices the items after 2 sites (yes I need both of the sites for more accuracy, sorry). It is okay even taught they are not very accurate.
I would need someone that is able to put the scripts togheter like this:
The script should be able to respond to trades with the price taken from the 2 sites -(minus) 5% or something like that, than it should put the items in the mall and reprice them according to the 2 sites.
If it is possible to add a function that should chat in a channel something every 5-10 minutes it would be great if not it's fine.

Please help me...
 

Alhifar

Member
I wouldn't mind doing this, however I would need a little more description. Do you want to respond to ALL trade requests, or just certain items? As well, what items would you like to be put into the mall?

Also, I would recommend using mall_price() over either of those sites; for accuracy it should be better.

Finally, as far as I know, mafia cannot use chat, to prevent spambots. If I'm mistaken, I'm sure somebody will come and correct me.
 

blue

Member
well I would like it to respond to all of them since I will personally say in chat what I need(Oh and PLEASE don't forget that it should respond with 5-19% less than what it will sell in the mall for) and since I never know exactly what items I will want.
And yeah all the items that I baught should be put in the mall. Or if it's easyer my whole inventory...(I keep it empty... always).
Oh yeah can You make it possible to run constantly (the script like for example every 1 minute or so) so that I wouldn't have to reload it manually every time? (I once had such an script, a very little one that made another script reload every 1 minute but lost it)

Thanks a lot!!!
Oh yeah there are some things I collect like springs it would be great if the program could offer for things You can buy from the market and such a little bellow the price that You buy it from the market fore...
 
Last edited:

Alhifar

Member
This script should do exactly as you requested. There's a few things you can configure at the top, but otherwise it should work fine as is.

I will however tell you that I haven't been able to test it myself, because I don't really get many trade requests. Please tell me if there are any bugs or if something isn't how you want it!

EDIT: I have found that stuffies will confuse it, because they can be traded, but not malled.
 
Last edited:

blue

Member
Thank You. Where should I send the reward?

Oh yeah I found some bugs:
it responds to meat pastes and such with 60 meat / meat paste
it responds to cook oven and cocktailcrafting kit with 600 meat ( mall price is 500 meat)
it doesen't put the items in the mall. I guess that it dosen't sincronise(I guess that it's written like this) with the time when the trade is accepted
 
Last edited:

Alhifar

Member
You can send the reward to Alhifar (#1189456). Glad I could help

As well, I've attached a new version that should definitely fix the first two bugs, and I HOPE will fix the third. The third is a little harder because there seems to be no indication of when someone accepts your trade response, so I have it waiting 1 minute between accepting the trade and trying to put them in the mall. Tell me how that works.
 
Last edited:

blue

Member
It still offers 285 for meat stacks
For meat pastes 104 meat
And for dense meat stacks 2850
For cook ovens it now offers 1000 meat....
It just made it worse...
 

Alhifar

Member
Oops. Sorry about that. I accidentally used "||" instead of "&&"

This should fix that.

EDIT: Aha! I think I found a way to make sure all the malling succeeds.
 
Last edited:

blue

Member
I'm sending the item right now :D Thaks and hope it works :D
Oh yeah now the script just ignores theese items or what? :)
I'm asqing beacuse it ignores all the trades I have...
 
Last edited:

Alhifar

Member
It shouldn't ignore them... It should add the correct amount of meat for them. Can you post any cli output you have?
 

blue

Member
Could You please explain me what that is?
It just writes Waiting completed and then it counts again...
It responded to 2 out of 6 trades that I proposed...
 

Alhifar

Member
When you run the script in the Graphical CLI, it should output some information to the panel above where you type. For example:
Code:
> trade

Countdown: 1 minute...
is what appears when you have no trade requests and you run the script. Could you copy and paste that?
 

blue

Member
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
04/05/09 06:20 PM - Woogie_Pants has proposed a trade offer to you.
04/05/09 06:20 PM - Woogie_Pants has proposed a trade offer to you.
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Countdown: 30 seconds...

Actually the waiting time is 60 but it doesen't notice that
Listen It's Okay even if it doesen't put items in the mall as long as it can buy them...
 
Last edited:

Alhifar

Member
Okay, here's a debug version, it will print out quite a bit more to the cli, can you run that for me and copy/paste the results?
 
Last edited:

blue

Member
> call scripts\trade(2).ash

Entering continuous loop!
You have trade offers!
We've found our trades!
This is trade number 2159336
Trying to find price for dense meat stack
Dense meat stack: 1000 meat
Total before reduction: 1000
Total after reduction: 530
Offered 530 meat for trade number 2159336
Waiting for offer to be accepted
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Waiting for offer to be accepted
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Waiting for offer to be accepted
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Waiting for offer to be accepted
Countdown: 30 seconds...
Countdown: 15 seconds...
Countdown: 10 seconds...

I still have 4 trade offers and those that were responded have been accepted... sorry...
The first one works... can't You edit that one...
 

Alhifar

Member
Okay, I see what is happening. It looks like I'm going to have to take a little longer to get it to mall for you. In the meantime, this should do everything but place the items in the mall.

EDIT: Okay, I have 2 possible solutions for making it mall for you.

1) It can put your entire tradeable inventory in the mall each time it finishes responding to trades.
2) It can wait up to 2.5 minutes in 30 second increments for the person to respond, and then put only the items that were involved in that trade in the mall. If it waits 2.5 minutes and the person hasn't responded, then it will simply move on to the next trade.

Which solution would you prefer?
 
Last edited:

dj_d

Member
It's cool to see someone actually following forum rules in asking for help, and it's even cooler to see someone get a nice reward for their scripting! :)
 

Bale

Minion
I agree that was cool. I only regret that I didn't have experience with this sort of problem so I could score the reward. Congrats to Alhifar.
 
Top