|
Title: scripting primedice --- getting started Post by: tspacepilot on April 23, 2015, 05:45:11 PM This thread is just to give folks interested in scripting primedice's api a little help to get off the ground and going. I'm just showing a few shell scripts I've used to log in and send bets etc. These are expected to be run on a UNIX like machine with grep, sed, curl.
So, first thing you have to do is login and get your access token. Here's a little script that logs you in and saves your token in a file called "token". Use this script with your actual password and username as arg1 and arg2: Code: #!/bin/bash All this does is use curl to POST your login and then filters the output with sed. The last line just prints the token to STDOUT in case that's useful for another program that calls this. I'll show you guys one more, you can use this to send a bet using three args, the amount, the target number, and up or down ("<",">"). Note that because < and > are shell redirects for filedescriptors, you'll have to enclose the up/down in quotes. This is the script: Code: #!/bin/bash Again, the assumption here is that you ran 'login' already and have your access token stored in a file called 'token'. The script prints out "true" if you won and "false" if you lost. These basic scripts aren't really even scripts. They're just one liners to do the work of forumlating the curl command for you and keeping track of your access token. I've used them to write some betting algorithms in perl. I don't want to get too far into this, but some folks have asked me via pm for help in this so I thought this might get them started. If you wanted to write a true bot then you'd want to do something more than use sed to filter all the output from a particular request, you'd want to use a json parser and keep track of all the data that comes back each time and update your local record accordingly. The idea here is just to get you started if you want to play around with the api but need a few examples to get going. Hope this helps you guys! Have fun and safe betting! EDIT: Realized that I should say that to use this code you'd probably want to cut-n-paste the lines into a file and then save it and make it executable. For example, if you called my login script "login" then you'd say: Code: $ chmod 755 login And after that you could run it with: Code: $ ./login MYUSERNAME MYPASSWORD And similarly with the "bet" script, save it, make it executable, and call it with three args: Code: $ ./bet 10 50 "<" ^^ that's a bet of 10 satoshis on under 50. Title: Re: scripting primedice --- getting started Post by: Bitcoinerist on June 18, 2015, 01:17:24 AM Thank you for writing this and teaching this to everyone! It cleared some things up!
Title: Re: scripting primedice --- getting started Post by: xiionqz on June 18, 2015, 01:27:24 AM thanks man ;D
Title: Re: scripting primedice --- getting started Post by: tspacepilot on June 18, 2015, 02:43:42 AM Glad you guys liked it. Feel free to PM me if you want more help or just reply in this thread. I'm glad someone found this useful :)
Title: Re: scripting primedice --- getting started Post by: bitllionaire on June 18, 2015, 02:46:48 AM It's really cool
What uses do you think it is interesting to use the primedice api? Title: Re: scripting primedice --- getting started Post by: tspacepilot on June 18, 2015, 05:28:52 AM bitllionaire: at least for me, it's useful because I don't have to hit "click, click, click" until my wrist wears out. And I don't have to load the chat if I'm not interested in it (sometime's I'm intersted in it and you can use the API to chat as well, if you're interested, I can show you guys how). Basically using a script lets you take advantage of your computer to use primedice as you want to. I think the most obvious thing is to do autobetting with a more complicated pattern than the simple autobet functionality on the website, when you're using the api and a script, you can do whatever you would do using clicks but faster and with less effort.
Anyway, you guys tell me how you've used it. You said it was cool, what did you use it for? Title: Re: scripting primedice --- getting started Post by: raitpngman on June 11, 2016, 05:34:53 AM I've beat my head on this one and can' figure it out. How do I get the last 30 bets and send it to a file?
Title: Re: scripting primedice --- getting started Post by: tspacepilot on June 13, 2016, 09:24:25 PM I've beat my head on this one and can' figure it out. How do I get the last 30 bets and send it to a file? I haven't used primedice in over a year so I don't know if there have been any API changes which may be getting in your way. What did you try? How far did you get? What errors did you see? Title: Re: scripting primedice --- getting started Post by: greyhawk on June 13, 2016, 09:33:58 PM Code: #!/bin/bash It is best practices not to accept passwords as a cli arg as the password will appear in your .bash_history file in plaintext. It is better to prompt the user to enter the password like this: Code: #!/bin/bash That way it won't appear in the .bash_history file, when you run "history" or if you keep pressing "up" in the terminal window to scroll through command history. Title: Re: scripting primedice --- getting started Post by: DarkThrones on June 13, 2016, 09:44:35 PM Is there a way to make a script only bet if it sees certain conditions met? That's the only thing about a script I would be interested in. If you could help me understand that would be awesome.
Title: Re: scripting primedice --- getting started Post by: raitpngman on June 13, 2016, 11:11:13 PM Is there a way to make a script only bet if it sees certain conditions met? That's the only thing about a script I would be interested in. If you could help me understand that would be awesome. No problem. You can use counters, loops (while,for), and conditional statements (if, elseif, else). It gets a little like spaghetti if things get complicated, but you can make it work. Title: Re: scripting primedice --- getting started Post by: raitpngman on June 13, 2016, 11:16:06 PM I haven't used primedice in over a year so I don't know if there have been any API changes which may be getting in your way. What did you try? How far did you get? What errors did you see? result=$(curl -X GET https://api.primedice.com/api/mybets?access_token=$token) I called the api and it returned something. When I look in the variable or send the output to a file, it shows something like "mybets[]" I don't know if this is an empty array or I need to pass another variable to the api in the call or if the information is contained in the variable. I've tried to iterate through the array (but I'm new at scripting, google is a friend) but am unable to get anywhere. Title: Re: scripting primedice --- getting started Post by: raitpngman on June 13, 2016, 11:17:51 PM Is there a way to make a script only bet if it sees certain conditions met? That's the only thing about a script I would be interested in. If you could help me understand that would be awesome. An example while [ $better -le 60000 ] do result=$(curl -X POST --data "amount=$better&target=$target&condition=$condition" https://api.primedice.com/api/bet?access_token=$token 2>/dev/null | sed -e 's/.*"win":\(true\|false\).*/\1/') echo echo "$counter bet = $better" echo "result = $result" if [ "$result" = "true" ]; then let better=$amount elif [ "$result" = "false" ]; then let better=$(($better * 10)) else break fi let counter=$counter+1 done Title: Re: scripting primedice --- getting started Post by: DarkThrones on June 14, 2016, 01:57:33 AM Is there a way to make a script only bet if it sees certain conditions met? That's the only thing about a script I would be interested in. If you could help me understand that would be awesome. An example while [ $better -le 60000 ] do result=$(curl -X POST --data "amount=$better&target=$target&condition=$condition" https://api.primedice.com/api/bet?access_token=$token 2>/dev/null | sed -e 's/.*"win":\(true\|false\).*/\1/') echo echo "$counter bet = $better" echo "result = $result" if [ "$result" = "true" ]; then let better=$amount elif [ "$result" = "false" ]; then let better=$(($better * 10)) else break fi let counter=$counter+1 done Title: Re: scripting primedice --- getting started Post by: raitpngman on June 14, 2016, 03:15:44 AM Unfortunately you lost me. Or else I would be able to make the world's only profitable dicing script. It's fairly obvious what has to be done. Basically, you bet 0 and record the results until you get the results you want. Then you bet what you want. When you are done betting rest the variables and bet 0 again. The example was to help you with assigning variables, loops, and if/then statements. "Or else I would be able to make the world's only profitable dicing script." LOL, it is fairly elusive. I think I've actually made a profitable dicing script, but the return is abysmal. I'm better off throwing my money in the betting pool and taking other people's money. Title: Re: scripting primedice --- getting started Post by: tspacepilot on June 28, 2016, 03:10:01 PM "Or else I would be able to make the world's only profitable dicing script." LOL, it is fairly elusive. I think I've actually made a profitable dicing script, but the return is abysmal. I'm better off throwing my money in the betting pool and taking other people's money. A couple of things. 1) I haven't used primedice in years. It's possible that the API has changed and that the scripts in the OP no longer work. 2) As far as I know, if you've actually made a "profitable" dicing script, then what's happened is that you've been lucky. Assuming you're playing against a fair house with a house edge, it should be mathematically impossible to guarantee a profit. If you've got one, then you're just in a situation where you haven't yet converged to your estimated long-run return. Title: Re: scripting primedice --- getting started Post by: Daffadile on June 28, 2016, 06:29:27 PM Why make this bot script ? You know it won't help or is it just for fun like a challenge. It also needs your password and username isn't that a security risk ?
Title: Re: scripting primedice --- getting started Post by: seuntjie on June 29, 2016, 11:10:19 AM Alternatively, you can use DiceBots programmer mode and concentrate solely on your betting system/strategy.
DiceBot handles all of the interactions with the websites (as it supports other sites as well). Check out these links to get started with DiceBots programmer mode and skip all of these manual API calls and things: DiceBot: https://bot.seuntjie.com Programmer Mode: https://bot.seuntjie.com/programmermode.aspx Youtube tutorials: https://www.youtube.com/playlist?list=PLZH88mwZAXLxVtHpc3PIFamkiT1o2V3LX Programmer Mode Thread: https://bitcointalk.org/index.php?topic=1114503 Title: Re: scripting primedice --- getting started Post by: rianwarcil on June 29, 2016, 11:24:45 AM thanks before man ;) :*
Title: Re: scripting primedice --- getting started Post by: tspacepilot on June 29, 2016, 04:42:13 PM Alternatively, you can use DiceBots programmer mode and concentrate solely on your betting system/strategy. DiceBot handles all of the interactions with the websites (as it supports other sites as well). Check out these links to get started with DiceBots programmer mode and skip all of these manual API calls and things: DiceBot: https://bot.seuntjie.com Programmer Mode: https://bot.seuntjie.com/programmermode.aspx Youtube tutorials: https://www.youtube.com/playlist?list=PLZH88mwZAXLxVtHpc3PIFamkiT1o2V3LX Programmer Mode Thread: https://bitcointalk.org/index.php?topic=1114503 Thanks seuntjie, I'm not really trying to compete with your dicebot here. The point of this thread was just to offer up some scripting I was playing around with a few years ago in case anyone found it useful. Clearly there are those that have done a complete job of this work and if your point is just to bet automatically, then that's probably the best way to go. For me, playing around with scripts and coding is fun just for the education of it, so I'm often interested in a DIY approach even if it means that I wont end up getting as far as someone who's working full time on the job. BTW, when I last tried to look into your dicebot stuff (again, I think this was years ago), I want to say that I ran into some roadblock. I don't remember if it was that your stuff wasn't open source, or if it was just that your stuff is all in C#/.NET and there wasn't a reliable compiler on my system (GNU/Linux). Title: Re: scripting primedice --- getting started Post by: JasonXG on July 01, 2016, 09:41:43 PM Nice that you helping people. I know its legit but I have never liked adding my username and password to a not program. I'm scared it may be fake and steal it or someone manages to attain the files off my PC.
Title: Re: scripting primedice --- getting started Post by: tspacepilot on July 05, 2016, 02:36:33 AM Nice that you helping people. I know its legit but I have never liked adding my username and password to a not program. I'm scared it may be fake and steal it or someone manages to attain the files off my PC. What's a 'not program'? If you're talking about the script I posted above, simply read the code and do what you want with it. If you're talking about seunjie's dicebot, ask him if his code is open source and then read the code and compile it yourself. Title: Re: scripting primedice --- getting started Post by: freemanjackal on March 02, 2017, 12:44:54 AM i found this topic in internet, i want to login but i have 2af active, would you know how to pass this parameter, i am working with java by the way
Title: Re: scripting primedice --- getting started Post by: LuanX3 on March 02, 2017, 02:22:26 AM Nice that you helping people. I know its legit but I have never liked adding my username and password to a not program. I'm scared it may be fake and steal it or someone manages to attain the files off my PC. What's a 'not program'? If you're talking about the script I posted above, simply read the code and do what you want with it. If you're talking about seunjie's dicebot, ask him if his code is open source and then read the code and compile it yourself. I think it is much better to just use Seuntjie's dicebot and code from there. Since it is much more easier to do and it has already predefined stuff. It will not require too much knowledge of code too as everything is already built, you just have to input the behaviour of the bot to make it function. But, for those coder heads who want's to be free from other people's code, then I think this is for you. Title: Re: scripting primedice --- getting started Post by: tspacepilot on March 02, 2017, 04:14:16 AM i found this topic in internet, i want to login but i have 2af active, would you know how to pass this parameter, i am working with java by the way I posted these scripts back in 2015. I haven't really used primedice since around that same time. The API may have changed completely for all I know. Also, as you see, I didn't really put everything together into any particular package, I was just playing around with throwing things at the API and rolling by machine. Sorry I can't help more. I basically have no idea what's going on in PD these days. As LuanX3 said, you might be better off modifying one the existing dicebots. Title: Re: scripting primedice --- getting started Post by: freemanjackal on March 02, 2017, 05:01:27 AM i found the solution, with the new api there is no need to login, just specifying the api nothing else needed
thanks anyway Title: Re: scripting primedice --- getting started Post by: moooonu on March 02, 2017, 05:14:15 AM Awesome script man. THanks for sharing it with us. I prefer to use dicebot though. Its more simpler than your scribt.
Title: Re: scripting primedice --- getting started Post by: TOPBTCCASINOS on March 02, 2017, 07:40:08 AM I don't understand why people use this? There is an autoroll on the site already
Title: Re: scripting primedice --- getting started Post by: seuntjie on March 02, 2017, 08:18:56 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Title: Re: scripting primedice --- getting started Post by: freemanjackal on March 02, 2017, 03:32:25 PM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Title: Re: scripting primedice --- getting started Post by: Victorycoin on March 02, 2017, 09:53:43 PM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Title: Re: scripting primedice --- getting started Post by: TheGodFather on April 23, 2017, 03:50:19 PM Glad you guys liked it. Feel free to PM me if you want more help or just reply in this thread. I'm glad someone found this useful :) hoping that it can help my next game in primedice, i want to learn strategies to it too, because I am always lose the money that I have been deposited on it. Hoping that I will be the next millionaire in it, i hope that someday too that, I will earn a lot from it, and get back all the money that I have been losing in all my games there. Thanks for this man. Title: Re: scripting primedice --- getting started Post by: MrCrank on April 23, 2017, 03:54:34 PM Glad you guys liked it. Feel free to PM me if you want more help or just reply in this thread. I'm glad someone found this useful :) hoping that it can help my next game in primedice, i want to learn strategies to it too, because I am always lose the money that I have been deposited on it. Hoping that I will be the next millionaire in it, i hope that someday too that, I will earn a lot from it, and get back all the money that I have been losing in all my games there. Thanks for this man. I want try script too. need good profit strategy.. Title: Re: scripting primedice --- getting started Post by: abel1337 on April 23, 2017, 04:39:06 PM Helping other to win on a dice game is very good for you. It helps the starting gamblers even the gambling pioneers. It is essential to have a programming knowledge to make some money of it and to help others. By the way I want to try this too . I've sent you a pm
Title: Re: scripting primedice --- getting started Post by: MinerHQ on April 24, 2017, 01:31:23 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Yes, I too noticed this issue on crypto-games site. One time I was playing auto bet with 100 milliseconds time interval but when the losing streak extended the betting speed increased quite fast I lost some money. But until now I didn't understand why that speed increased. Anyway, I also never used any bots and even auto betting also very seldom I use it. Title: Re: scripting primedice --- getting started Post by: karmamiu on April 24, 2017, 05:15:43 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Yes, I too noticed this issue on crypto-games site. One time I was playing auto bet with 100 milliseconds time interval but when the losing streak extended the betting speed increased quite fast I lost some money. But until now I didn't understand why that speed increased. Anyway, I also never used any bots and even auto betting also very seldom I use it. Because its clearly that you are no longer the one controlling the pace of the game, maybe your the one who sets it up but its already beyond your reach when you are using scripts, bots and auto bets. This is why for me i would rather choose to bet manually than using those scripts so i can control my loses that wouldn't exceed too much as i expecting. Title: Re: scripting primedice --- getting started Post by: BTCevo on April 24, 2017, 07:04:52 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Yes, I too noticed this issue on crypto-games site. One time I was playing auto bet with 100 milliseconds time interval but when the losing streak extended the betting speed increased quite fast I lost some money. But until now I didn't understand why that speed increased. Anyway, I also never used any bots and even auto betting also very seldom I use it. If I am not wrong they have minimum bet so it will always increasing speed of betting when it goes for higher bet. May be you should try to set stop on loss or stop on win in order not to lose so fast and lost much. But we never know when the luck is coming that is why I usually always set on max balance that I am willing to bet, lose everything or gain good profit Title: Re: scripting primedice --- getting started Post by: karmamiu on April 24, 2017, 08:09:49 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Yes, I too noticed this issue on crypto-games site. One time I was playing auto bet with 100 milliseconds time interval but when the losing streak extended the betting speed increased quite fast I lost some money. But until now I didn't understand why that speed increased. Anyway, I also never used any bots and even auto betting also very seldom I use it. If I am not wrong they have minimum bet so it will always increasing speed of betting when it goes for higher bet. May be you should try to set stop on loss or stop on win in order not to lose so fast and lost much. But we never know when the luck is coming that is why I usually always set on max balance that I am willing to bet, lose everything or gain good profit Yes and also if sometimes you forgot to see some little mistakes it would also lead to a bigger loss. Like what he was saying he lost instantly without noticing it, so it should be really advisable to check first before you click the bet, or it would be best if you would put some stop limit. Title: Re: scripting primedice --- getting started Post by: Cactushrt on April 24, 2017, 08:32:52 AM Helping other to win on a dice game is very good for you. It helps the starting gamblers even the gambling pioneers. It is essential to have a programming knowledge to make some money of it and to help others. By the way I want to try this too . I've sent you a pm Right scripting dice site to help gamblers is a good idea it's also nice to see that this script is free unlike those people trying to fool us, I really don't believe those scripts in dice sites but seeing this kinds of tips are really awesome. Goodluck dudeTitle: Re: scripting primedice --- getting started Post by: MinerHQ on April 25, 2017, 02:48:55 AM I don't understand why people use this? There is an autoroll on the site already Yeah but the auto roll sucks. What if you want to automate a betting system other than simple martingale, like labouchere for instance. Or d'alembert. Or you need a way to reset the bot after x profit, or stop after y loss. Or automatically withdraw you profits to your wallet. People use other bots/custom bots for more features/settings/automation. Yes, I too noticed this issue on crypto-games site. One time I was playing auto bet with 100 milliseconds time interval but when the losing streak extended the betting speed increased quite fast I lost some money. But until now I didn't understand why that speed increased. Anyway, I also never used any bots and even auto betting also very seldom I use it. Because its clearly that you are no longer the one controlling the pace of the game, maybe your the one who sets it up but its already beyond your reach when you are using scripts, bots and auto bets. This is why for me i would rather choose to bet manually than using those scripts so i can control my loses that wouldn't exceed too much as i expecting. I accept that if these things happen when you use some external bots but if it happens when you use site auto bet mode then it is not correct. Because after even setting some fixed milliseconds for each bet still, you can see the speed increase while losing streak then don't know how to explain it. I also never use any external bots but only sometimes use auto settings for few minutes. Title: Re: scripting primedice --- getting started Post by: Snoekie21 on January 19, 2019, 01:15:14 PM Thanks for providing this script! Will check out it soon!
Title: Re: scripting primedice --- getting started Post by: raven7886 on January 21, 2019, 03:42:35 PM Thanks for providing this script! Will check out it soon! Why you are bumping a 2 years old topic ? Are you deliberately looking for a bot ?Calm down, you get faster with the amount going up. Almost all websites, including primedice, slows down the small amounts and allows the big ones to go through first. Which means if you are playing autoroll on a martingale looking strategy that means when you gamble 100 satoshis and lose it will be slow however with 200-400-800-1600 it will go faster and faster because the amount is increasing as well. There is literally a provably fair function that makes sure you do not lose money to the casino because they are screwing you, you can literally check every single bet you made into them but here you are talking about how "fast" it got when you were losing. I mean I have seen soar losers before but that is the upmost anyone ever went for it tbh with you. Title: Re: scripting primedice --- getting started Post by: Victorycoin on January 27, 2019, 07:56:32 PM Nice that you helping people. I know its legit but I have never liked adding my username and password to a not program. I'm scared it may be fake and steal it or someone manages to attain the files off my PC. Though it might be a legit and helpful program but it can be highly caution. As there are a lots of script only to destroy others money by stealing credentials. |