Poker game... - 01/12/05 11:30 AM
I am creating a text based poker game but im new to mirc script to as expected ive run into a bump...
The last 2 lines of /select are meant to simply check if a card has already been dealt. In variables, i have all the cards set to 0 meaning none have been dealt yet. However, this code fails becuase i cant figure out how to read the content of variables dynamiclly. I need to be able to check the content of a variable named with the %card variable. In other words, %card is set to sa, and i need to check the content of %sa, if it says dk, i need to check %dk. If that function works properly, then /occ would only mark undealt cards. and thats my only problem at the moment
thanks in advance for any assistance.
Code:
/select { /set %num $rand(2,14) /set %suit $rand(1,4) if ( %num < 10 ) { %num = %num } if ( %num = 10 ) { %num = t } if ( %num = 11 ) { %num = j } if ( %num = 12 ) { %num = q } if ( %num = 13 ) { %num = k } if ( %num = 14 ) { %num = a } if ( %suit = 1 ) { %suit = d } if ( %suit = 2 ) { %suit = h } if ( %suit = 3 ) { %suit = c } if ( %suit = 4 ) { %suit = s } /set %card %suit $+ %num if ( % [ $+ %card ] == 0 ) { /occ %card $$1 } else /select $$2 } /occ /set % $+ $$1 $$2
The last 2 lines of /select are meant to simply check if a card has already been dealt. In variables, i have all the cards set to 0 meaning none have been dealt yet. However, this code fails becuase i cant figure out how to read the content of variables dynamiclly. I need to be able to check the content of a variable named with the %card variable. In other words, %card is set to sa, and i need to check the content of %sa, if it says dk, i need to check %dk. If that function works properly, then /occ would only mark undealt cards. and thats my only problem at the moment
thanks in advance for any assistance.