Alternate Trade Response Script

Nightmist

Member
Yeah before anyone says anything... I know its messy++... but anyway... Anyone trying to read and understand this script better have some sort of pain killers for the massive headache your bound to get =P.

Currently Supports: (Assuming I didn't break it while doing some editing. after my last test.)

  • [li]Group Based Trades
    - This is "when X set of item/s and meat is offered, attempt to respond with Y set of item/s and meat". X and Y being static.[/li]
    [li]Variable Quantity Items for Meat
    - This is where "When listed item/s is offered, respond with Quantity*PlayerSetPerItemAmount Meat".
    - This is independant from the Group Based, so a Group Based that uses the listed items shouldn't affect what the group trade does.[/li]
    [li]An option to allow "creation of items" in order to meet a reqest.[/li]
    [li]A blacklist ability, you can fill out a map for blacklisty-badness... okay bad joke.[/li]
    [li]A option to choose to save a log with "PlayerID<tab>TheItemTraded<tab>DateLastTradedFor(In YYYYMMDD, eg today_to_string())[/li]
    [li]A option to save a "session log" with "TradedItem<tab>TheQuantityTraded"[/li]
    [li]A option to have a "Total History" where its the session log but... carries of sessions[/li]
    [li]A "limit" for the group trades.[/li]
    [li]A "don't auto-decline" option.[/li]
    [li]A "even if don't auto-decline, auto-decline from blacklisted people" option. (To work with the above option)[/li]

Currently Planned To Support...Maybe...

  • [li]A "request" based system where they put some sort of request in the trade note and then the script would act according to that and the items sent with the note.[/li]
    [li]... Ummm thats about it actually, possibly the ability to add custom messages to trade notes aswell.[/li]
    [li]Limit options for the other types of trades. (Request and VarQty)[/li]

Well anyway, both text files needed are below. The settings and anything player-input needed should be in the config file but when running the script, run the other file.

Edit: Well yeah it helps if you upload the right files eh...
Edit2: Okay and it might throw spas errors when you try to run it and don't have that local file (Just create one, it can be blank if you want)... Oh and remember to change the import!
Edit3: Well A major bug should be fixed. Hopefully... (Group trading screwyness with meat involved)
Edit4: New 'config' file has been uploaded. Just has more descriptive comments to help people using this script. (Which I personally doubt anyone is =P but oh well) I also added some things to my "To-do" list.
Edit5: Well updated buggy-ness for you all! Some new features added from the to-do list!
 

Attachments

  • TradeBot.ash
    12.3 KB · Views: 112
Whistles innocently...ya know whats left? I got a trade proposal script out there, we've both written trade responding scripts. We now need a trade accepting script...one which will verify first that the expected response was recieved, then if so accept.
 

Nightmist

Member
[quote author=efilnikufecin link=topic=511.msg2492#msg2492 date=1160459262]
Whistles innocently...ya know whats left? I got a trade proposal script out there, we've both written trade responding scripts. We now need a trade accepting script...one which will verify first that the expected response was recieved, then if so accept.
[/quote]
Heh, it shouldn't be too hard, well a basic "static X item/s and meat for Y item/s and meat", type shouldn't, a "X meat per Y item" shouldn't be too hard either, I'm just worried about the "X of S or O or M or E item/s and meat for Y item/s and meat".

I'll see what I can whip up, if I have time... I have 200 turns banked on my HCO character and he's been using the gym far too much lately just to avoid the rollover cap >>.
 

Nightmist

Member
[quote author=efilnikufecin link=topic=511.msg2534#msg2534 date=1160885765]
ZOMG! I just noticed you have Jick blacklisted in the script by default! :D
[/quote]
That I do =P, and if that results in people getting really annoyed because it auto declines a request from Jick then... >> Well too bad, if you do then just think of it as my jealous revenge >>

Speaking of which I need to update this thing... (Cursed exams) >>. I might add a "Leave trade offers rather then auto-decline" option and then add a "Auto-decline blacklisted persons" plus a "Auto-decline from X people".

PS. Updated "config" file added. This one is exactly the same but just with more descriptive comments. (No the above options haven't been added yet, and neither has my request trade system. Which probably won't come out until ages =P although the config file does have the explanation on how to use it when it is added.)

Edit: Okay I just realised that why would I need a auto-decline from X people when you could just blacklist them and then set the auto-decline from blacklisted people on...
Edit2: I can't spell "decine" >> uh "decline".
 
[quote author=Nightmist link=topic=511.msg2539#msg2539 date=1160981050]
That I do =P, and if that results in people getting really annoyed because it auto decines a request from Jick then... >> Well too bad, if you do then just think of it as my jealous revenge >>[/quote]

HaHa! seriously there are instances where Jick will propose a trade offer to you. One such instance is when you donated $10 to get a Mr. Store familiar, and they didn't get your donation processed fast enough. You make contact via bug report, administration contacts Jick, and a trade commences.

Blacklisting Jick is funny and all, but I sure would hate to be that kid who mowed someone's lawn to get a Special Mr. Store familiar, and go through all that effort to get it only to have this script cancel the trade!
 

Nightmist

Member
They don't magic the item into your... Ohhh I get what you mean now, hmm... *Goes and edits config file*

Edit: Heh =P I'll content myself with using that as an example rather then actual part of the blacklist.

Edit2: Hey cool you can remove and then repost >> To avoid double posting but still inform people theres been a update!

Updates as listed below, beware, possible bugs as I haven't tested this script.
- Auto-decline is now a option!
- Auto-decline from blacklist even when don't auto-decline!
- Option to send notification of "Failed" Kmail.
- "Limit per day" for group trades. (Uses local date though, will be changed to use IsNewDay() at some later date)
- Many unknown bugs! No wait.. >> Ah what the hell its probably true xD.
 

dragonslayere

New member
??? :eek: is this topic really 120 days old?

anyways i was looking for a tradebot/script and this script meets all my needs.. but when i try to test it i get

Code:
> call scripts\Tradebot\TradeBot.ash
String index out of range: -1

i would really appreciate it if someone will help me to get it to work
I'm using the newest version of kolmafia 11.2, if that has anything to do with the script not working. or maybe i forgot to edit something, any replies will be much appreciated.
 

hippymon

Member
I have no clue how to work this script... :-\
It is probably completely obvious where to do it at but... where exactly do you edit it for the items you buy and the price? ???
 
[quote author=hippymon link=topic=511.msg5227#msg5227 date=1185325504]
I have no clue how to work this script...
It is probably completely obvious where to do it at but... where exactly do you edit it for the items you buy and the price?
[/quote]TradeBot Config.ash
######################
# UseVarQtySwap Maps #
######################
int [ item] VarQtySwapMap;
# This is a simple "Send X meat per Y item for trade".

# Example:
# VarQtySwapMap[ $item[meat paste]] = 9;
# The script should reply to a trade offer of 2 meat paste with a response of 18 meat.

# Notes:
# You should probably have the number under auto-sell ;-)... You don't HAVE to though...
# like with sewer items you might have higher then autosell but then still less than 100.
# Typo's in this section are BAD, adding a extra 0 on that meat paste example will end up
# with you sending the guy 90 meat per meat paste... and if the guy abuses that then your
# gonna run out of meat FAST.

# Easy template:

# VarQtySwapMap[ X] = HowmuchMeatPerItem;

# Remove the "# " at the start of the lines and remember to leave the ";" in the code.
# X = The item to reply//buy for meat

# Add your code under here:

[quote author=dragonslayere link=topic=511.msg5221#msg5221 date=1185252087]
is this topic really 120 days old?

anyways i was looking for a tradebot/script and this script meets all my needs.. but when i try to test it i get

Code:
> call scripts\Tradebot\TradeBot.ash
String index out of range: -1

i would really appreciate it if someone will help me to get it to work
I'm using the newest version of kolmafia 11.2, if that has anything to do with the script not working. or maybe i forgot to edit something, any replies will be much appreciated.
[/quote]

Nightmist may need to do a major re-write. A long time ago I had to rewrite my trade scripts for this same reason. There was an indexing change in kolmafia shortly after this script and mine were written.
 

radcliffe

New member
and where in the config ash should I write:
# VarQtySwapMap[ $item[meat paste]] = 9;
??? sorry for the stupid question...

OK I found out where... but it doesen't work... it tell me: That the tradebot/tradebot config.ash not found... I tryed to put them in the same folder togheter in the scripts alone or whit other programs... I even tryed to put the config out of the scripts menu... nothing works... I have written like this:
# Easy template:

# VarQtySwapMap[ X] = HowmuchMeatPerItem;

# Remove the "# " at the start of the lines and remember to leave the ";" in the code.
# X = The item to reply//buy for meat

# Add your code under here:

VarQtySwapMap[ $item[meat paste]] = 9;




#######################
# UseRequestSwap Maps #
#######################

What's wrong?
 

radcliffe

New member
Thank You very much for both answers ^_^
It doesen't work any of them... I made my own list of like 1.5k-2k items that I usually buy and it always finds the error:
Expected :, found price(traderesponse-ver2.ash, line 122)
I deleted that line ad it still found this problem... is it my fault???
There are also some untradable items in there ( on line 122 not ) should I take them away?

God it was hard... but I read all those scripting things on the internet and found out the problem... ( I could had just checked you message closer but... ) Iforgot the ; >.<
 
Top