Forums

AuthorPost

Advertisement - Register or Sign In

img  
Ravi

I am considering writing up an AI for Liars' Dice - while I setup the framework, does anyone have any suggestions for how the logic should work for it?

img  
x13420x

I will write one using autoit and then run it off my computer....if you have a suggestion for a better scripting program please tell me.

img  
x13420x

Oh may be difficult for the bot to see what cards it has. I am thinking of maybe somehow looking at what the image file name is..... not sure.

img  
Ravi

AutoIT is a good choice. However, like you mentioned, it will be difficult to identify the dice especially because they are not images. How about you code the logic in JavaScript, and I'll add it to the game as an AI? :)

img  
x13420x

Will be extremely resource heavy and I don't want to give away my algorithm.

img  
x13420x

You can't output the text in the same color as the background to ai bots can see what's going on?

img  
x13420x

I mean output the player's hand in white so the bot can easily read what cards he has.

img  
Ravi

Actually, if you write in javascript, you could even run the code through your browser. It will be much easier than using AutoIT to recognize the cards - think about everytime there's an interface change :P

img  
x13420x

Easier but very insecure....the database is like 70 mb......I doubt the browser can effeciently churn through that amount of data.

img  
Ravi

found this online: http://web.stanford.edu/class/cs109l/unrestricted/assignments/assn2/liars_dice.pdf

img  
x13420x

pdf is gone1

img  
Ravi

Yah, they must've taken it down. It was basically an assignment on coding an AI for liars' dice.

img  
x13420x

http://code.tutsplus.com/tutorials/how-to-build-a-python-bot-that-can-play-web-games--active-11117

:-) I have been spending hours trying to figure how to do it then I found this on hackers news wire

img  
x13420x

http://web.stanford.edu/class/cs109l/unrestricted/assignments/assn1b/main.pdf

img  
x13420x

if hex(PixelGetColor ( 328+$nextone,723,$hWnd),6) = 333333 then
if hex(PixelGetColor ( 310+$nextone,705,$hWnd),6) = 333333 then
$dice[$x] = 5
elseif hex(PixelGetColor ( 310+$nextone,745,$hWnd),6) = 333333 then
$dice[$x] = 3
else
$dice[$x] = 1
endif

img  
x13420x

elseif hex(PixelGetColor ( 310+$nextone,705,$hWnd),6) = 333333 then
if hex(PixelGetColor ( 310+$nextone,723,$hWnd),6) = 333333 then
$dice[$x] = 6
else
$dice[$x] = 4
endif
else
$dice[$x] = 2
EndIf

img  
x13420x

Finally I am figuring out how to get info from the screen using autoit. Took a while because I use zoomed in settings so the color reading were coming out bad.....then I realized I needed to just multiply all the coords autoit gave me by 1.5 and then everything works. :)

img  
Ravi

glad to see you're making progress :)

img  
Ravi

we finally have a bot, -AI-Madron

img  
x13420x

pretty awesome to be able to have a game with 10 players

img  
Ravi

Did you get to play 9 other humans?

New Post

Please Sign In to contribute to the Forums.