Controlling a game with a script
You have downloaded a game which consists of betting, you don’t want to play, but you want to earn some money, create a script which controls the program so you can bet automatically
The program: https://pastebin.com/DZ04YNWu
Please can someone create a script which is able to control the program and pass to me the code?
I’d like to learn something about processes…
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
r4v463 Can you help me?[/quote]
What is this? Private chat?
[quote]Please can someone create a script which is able to control the program and pass to me the code?
I’d like to learn something about processes…
So we have to create the script and you will magically learn? Try learning by doing research and trying stuff out yourself.
In any case, please make a live version of this code. I would love to bet some money given this implementation…
Yesterday I looked for an hour and didn’t found anything…
Just controlling the keyboard but is not exactly what I want.
I’m using Popen, from subprocess do you recommend me any other library?
[quote=@dloser]In any case, please make a live version of this code. I would love to bet some money given this implementation…[/quote]
Was this ironic? :S
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
Try controlling that script and then explain how did you did it.
And… What do you mean with a live version?
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
Make a script which can control the program so for example:
bet 5$ with a 50% win probability
if you lose, make the same but with 10$
then with 20$
then with 40$
and so on….
Something like a bot…
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
Well, I can’t control the program maybe you can…
this is my code:
```
from subprocess import Popen, PIPE
import time
def keypress():
p = Popen([‘python’, ‘wannaBeRich.py’], stdin=PIPE, stdout=PIPE)
p.stdin.write(‘n\n’)
i=0
while i<100:
p.stdin.write(‘1\n’)
i+=1
keypress()
```
My idea is to bet 1$ with a 1% probability of winning for a 100 times,
But doesn’t work…
Help me pls
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
weird, Doesn’t appear the name of the program…
edit: well, imagine before the comma is written the name of the process
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
Can’t check right now, but it probably works. It just won’t do what you expect it to do.
Here are some tips:
Always try debugging your code. Add some print statements to see what’s happening. That way you can give more useful information to the people you ask help from instead of just dumping code in their laps. It might even allow you to solve the problem yourself!
Try reading from p.stdout. If you don’t the game will block.
Ok, I’ve been looking to p.stdout, but my code still doesn’t work.
Can you tell me where I’m wrong?
https://pastebin.com/7qvEbruP
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi
Human Stupidity , thats why Hackers always win.
? Med Amine Khelifi