PDA

View Full Version : Request for a script for giveaways



blue
04-21-2009, 11:07 AM
My birthday is coming soon and I have like thousands of clovers, surprise eggs and booze to give away.
I re-edited everything in the second post...
Thank You very much!
And I am sorry for the low price. I am sure I will get more and send You more it's just that that is the lowest I will give...

blue
04-29-2009, 01:07 PM
Okay now I will be offering a MR. ACCESSORY to the person who can make this script and will do it as following:
- It should respond to 1-meat trades with DB-made booze (I kind of forgot
- It should respond to 2-meat trades with hi meins
- It should respond to 3-meat trades with twinkly wads
- It should respond to 4-meat trades with clovers
I should have the ability (And please explain exactly how) to change how many of each is offered in a trade: For example I should be able to decide if I give away 3 DB-drinks or 30 to each trade.
Also once a person proposed one kind of a trade (for example he proposed a 1-meat trade allready today) he should not be able to propose a 1-meat trade again untill rollover, but should still be able to propose trade with the others: but once he proposes one trade with 2 meat for example that day he shouldn't be able to propose another one of those neither until rollover!

Thank You very much and please HURRY!

zarqon
05-05-2009, 07:11 AM
Here you go Blue! Hope this is in time for your birthday.

This will respond to trades once every minute, declining trades with the same amount of meat in the same day, and responding to other trades with 1-4 meat as you specified above. The item amounts are currently set at 1, but that is easy to change at the top of the script. You might also want to change the message that gets sent along with your trade (also at the top).

There were a few things I was unclear about:

1) Do you want to send both advanced and super-advanced DB drinks? This one only sends super-advanced drinks.
2) What do you want it to do if you are out of a certain item? Currently I have it just skip the trade.

If you'd like either of those handled differently, let me know.

This will create a data file called tradeawaydata.txt in your scripts directory, which you can safely move to your data directory.

blue
05-05-2009, 12:09 PM
Thank You very much! I'll be sending the Mr. A when i get home!
And yes it would be pretty good if it would offer superhuman too. I am thinking of offering 5-10 drinks to each person... and 2 days ina row that would mean like 2-3k people... a bit too expensive...
And if I'm out of something can it buy them? If it's not possible it's OK

zarqon
05-05-2009, 06:21 PM
Okay, I've updated my previous post. The new version will send any DB drinks (both advanced and superhuman), and will attempt to buy more items if you are out of them, but only if you have "buy from the mall" checked in preferences. Everything else works as before.

And now, a minor complaint directed at no one in particular:

What is the deal with advanced cocktails having noncontiguous item numbers?? Totally skanked up my algorithm. Seriously.

blue
05-06-2009, 03:56 PM
Okay It'll take one more day for the bank of kol to give me the meat back in order to buy the Mr. A... Also it seems like it has some problems... it denies all the 1 meat and 2 meat trades

zarqon
05-06-2009, 04:01 PM
It's probably denying them because you already offered that trade today. The same person cannot offer more than one of the same trade in a day (even if you restart mafia, it will remember -- that's what the tradeawaydata.txt file is for). If you're only testing it out, delete the tradeawaydata.txt file and it will respond to the trades again (once per person per day).

blue
05-06-2009, 04:57 PM
No it's not that... I tested it myself and that's not the problem... it's beacuse I'm out of cold hi meins and neuromancers and it can't find any in my inventory anymore... I have like 2k other kinds of hi meins and 5k other kinds of booze... but it can't find them... the first script did that taught...

zarqon
05-06-2009, 05:40 PM
Okay... I didn't have time to test this (it's very late in Korea now) but here's a version with a different approach to choosing which drink to send, and it specifically tries to buy items you lack rather than using retrieve_item(). Let me know if this fixes it.

blue
05-06-2009, 05:51 PM
> call scripts\Giveawayz\tradeaway.ash

Parsing trades...
You have 9 incoming trades.
Processing trade 2183477: 2 meat from yueli7...
Offering yueli7 3 spooky hi mein...
There was a problem processing the trade.
Processing trade 2183479: 4 meat from Blasmeister...
Offering Blasmeister 25 disassembled clover...
Processing trade 2183480: 2 meat from Tiny Plastic MikeMar...
Offering Tiny Plastic MikeMar 3 spooky hi mein...
There was a problem processing the trade.
Processing trade 2183481: 1 meat from LordDragon...
Offering LordDragon 5 mandarina colada...
There was a problem processing the trade.
Processing trade 2183482: 2 meat from LordDragon...
Offering LordDragon 3 spooky hi mein...
There was a problem processing the trade.
Processing trade 2183483: 1 meat from yueli7...
Offering yueli7 5 mandarina colada...
There was a problem processing the trade.
Processing trade 2183484: 3 meat from LordDragon...
Offering LordDragon 15 twinkly wad...
Processing trade 2183485: 1 meat from cyber cat2...
Offering cyber cat2 5 mandarina colada...
There was a problem processing the trade.
Processing trade 2183486: 4 meat from LordDragon...
Offering LordDragon 25 disassembled clover...
Countdown: 1 minute...


Sorry it doesen't... And It's not beacuse of the list...

zarqon
05-06-2009, 06:12 PM
A few more tweaks. This version works fine for me...


Parsing trades...
You have 3 incoming trades.
Processing trade 2183507: 1 meat from Zarqon...
Offering Zarqon 5 ducha de oro...
...response sent.
Processing trade 2183508: 2 meat from Zarqon...
Offering Zarqon 5 cold hi mein...
...response sent.
Processing trade 2183509: 4 meat from Zarqon...
Offering Zarqon 1 disassembled clover...
...response sent.
Countdown: 1 minute...

blue
05-07-2009, 04:13 PM
Okay I found a new bug... sorry for that... also it seems like the bank hasn't read my withdrawl message.
It looks like the bot doesen't buy things from the mall... it thinks it responds to trades but doesen't... then after 1 minute it declines the trades beacuse it actually thinks that it responded to the same amount of meat...

zarqon
05-08-2009, 03:29 PM
Odd (and unfortunate) that it would work fine for me and not for you.

I've just gotten home from work and had a chance to take a look at it again. Since I can't create the problem you're having myself, here's a "debug version." Run this version and then either post the CLI output here or PM it to me. That might give me some clues as to what's causing the problem. Again, it worked fine for me:


Parsing trades...
You have 1 incoming trades.
Processing trade 2184927: 2 meat from Zarqon...
Initial item selection: cold hi mein
Item amount: 5
2 cold hi mein is more than 0 none...
Final item selection: cold hi mein (2 in inventory)
Offering 5 cold hi mein to Zarqon...
Searching for "cold hi mein"...
Purchasing cold hi mein (3 @ 5,395)...
You acquire cold hi mein (3)
Purchases complete.
Visiting counteroffer.php?action=counter&whichoffer=2184927&pwd&howmany1=5&whichitem1=1593&memo2=Happy birthday to me!
...response sent.
Countdown: 1 minute...

Don't bother sending the Mr. A unless I actually get you a functional script! Sorry it didn't work right "out of the box."

blue
05-15-2009, 04:38 PM
Okay... sorry... my computer broke down... I'm trying it out right now

zarqon
06-05-2009, 05:13 PM
...

Any word on whether this script worked?

codster62
07-17-2009, 05:49 AM
Well thanks to zarquon, I also gave alot more to give, so I will be using this script soon. :) Thanks, and Blue, tell me if this is working for you so I may use it.

zarqon
07-17-2009, 05:56 AM
I never heard anything from blue about whether this script worked or not. I put a good bit of effort into this, and every version of the script that I posted worked fine for me. By now I have assumed that blue's promised reward will never arrive. I will not be writing any further scripts for blue.

codster62
07-17-2009, 06:00 AM
Sorry to hear that zarquon. Some people will do that too you. I have been scammed recently as well. :)

codster62
07-17-2009, 06:13 AM
Anyways, I need to know how to change the script to add more items for giveaways and modify the default ones in the script. I have not taken a good look at the script yet, but I do not know advanced scripting which is what you use, so I would not do to good editing it. :)

codster62
07-18-2009, 04:27 AM
Ok, I have downloaded the script, and am using it. Works fine for me. I might give you a gift later since Blue has not responded. :P

dj_d
07-20-2009, 05:06 AM
Hm. I don't think Blue's been on the site since his last post. Do you have his playername (perhaps via notify()) so that we might "remind" him should we run across him ingame?

Alhifar
07-20-2009, 08:58 PM
bluevampiri is the only name I have for him.

codster62
08-15-2009, 02:25 AM
Yarghhh. I am trying to start a free fruit giving away... It worked for a good amount of time, about an hour actually. XD Then I get this error and it crashes.

Begin index 882 greater than end index -1 (tradeaway.ash, line 98)

Please help ASAP!

codster62
10-13-2009, 01:50 AM
Ok, I need help from somebody. I am going to be constantly buying certain items, and I need this script tweaked so that if somebody proposes a trade with X amount of an item, I will respond to the trade with N meat * X. Basically the script needs to be flipped around so I can make this work. I can give whoever helps out a chunk of DG for there troubles, although I imagine this won't be much work to do.

GhettoTrucker
10-13-2009, 02:52 AM
Ok, I need help from somebody. I am going to be constantly buying certain items, and I need this script tweaked so that if somebody proposes a trade with X amount of an item, I will respond to the trade with N meat * X. Basically the script needs to be flipped around so I can make this work. I can give whoever helps out a chunk of DG for there troubles, although I imagine this won't be much work to do.
I've also been looking into writing a script like this. I hadn't seen this thread til now. If I come up with anything, I'll be sure to post it here.

codster62
10-13-2009, 12:42 PM
Ok, sounds good. :) So now two people are wanting a script like this. Anybody want to help out with some info, or just modify it themselves and post it here? :) Small reward still involved(Chunk of DG).

mredge73
10-13-2009, 02:16 PM
first of all you guys will need to modify the record and the parser to be able to recognize items in a proposed trade. This probably won't be an easy task.
I would try to use the extract_items(url) command on the trade to see if that works, it is designed for use in kmails but may work for purposed trades. If this doesn't work you guys will need to build a matcher or use zlib's excise() command. I can help you guys but I am not going to do the leg work. All X and N varabiles need to be clearly defined as well.

post what you have done so far as well as the html source code of a trade if you havn't parced it correctly yet.

GhettoTrucker
10-13-2009, 04:47 PM
first of all you guys will need to modify the record and the parser to be able to recognize items in a proposed trade. This probably won't be an easy task.
I would try to use the extract_items(url) command on the trade to see if that works, it is designed for use in kmails but may work for purposed trades. If this doesn't work you guys will need to build a matcher or use zlib's excise() command. I can help you guys but I am not going to do the leg work. All X and N varabiles need to be clearly defined as well.

post what you have done so far as well as the html source code of a trade if you havn't parced it correctly yet.

Those are some things I have been looking into. The extract_items() part, at least. I'm at school right now, I was hoping to get some time between classes or later on tonight to try and put some pieces together. I figure the parsing will be the majority of the work, beyond that its simply replying to a trade. I'll post what I have when I get some things finished up on this.

codster62
10-13-2009, 09:32 PM
The parsing and replying to trades has already been taken care of in this script, so mostly, you will just need to modify it rather then creating a whole new parser and script. Anyways, this is far beyond my scripting knowledge, so good luckQ!!