Made it for fun..
http://www.youtube.com/watch?v=g3u3IGgeOaQ
watch in best quality
"!roll" will roll a 100 faced dice and say the result in green if 58 or over and in red if 57 and less.
"!total" will display curent total rolls, wins and loss.
Here is my code
Code:
program DiceBot;
{$i srl/srl.simba}
var
X,Y,Roll,Count,DoWeRoll,DoWeTotal,CountL,CountW,counter:integer;
procedure TypeSendExx(Text: string; PressEnter: Boolean);
var
I: Integer;
begin
for i := 1 to Length(Text) do
begin
{$IFDEF SIMBAMAJOR980}
SendKeys(Text[i], 1 + Random(1));
{$ELSE}
SendKeys(Text[i], 1 + Random(1), 1 + Random(1));
{$ENDIF}
Wait(1);
end;
if (PressEnter) then
TypeByte(VK_ENTER);
end;
function DaTotal:boolean;
begin
DoWeTotal := DTMFromString('mbgUAAHic7c7BCoMwDAbgtI/m+x/FzeFhoIM5hV2ttro/XYRSHBZ2beA7NPmbtiCiMsEVLlBBDTfpnWki90h74gGd4PMTBnhBD+OBXuaceyfidyZFtIKBGRaw4EBpBPQ3E9tnm9x3cm+RPUZ6cSY8m4N5uMMKfou5oGd//GHPKp3+T5+hLfNycanM+78+/dKs5w==');
if finddtm(DoWeToTal,X,Y,34,444,250,455)then
begin
result:=true;
end else
begin
result:=false;
end;
freedtm(DoWeTotal);
end;
function DaRoll:boolean;
begin
DoWeRoll := DTMFromString('mRAUAAHic5c3bCYAwDAXQdAdBreALBMdw/xnUWh9z6BUihFKw4mcDh6bkhgxElKh3aSDNbw4ZFB6a56WjgRoqaB1doD5QxbfumyNMMIOBBSyscMDOmaffeGY5a3h34pwkZ759+V8EN/flfkhuE4jOyMVdKnJ/6wIWV4Bf');
if finddtm(DoWeRoll,X,Y,34,444,250,455)then
begin
result:=true;
end else
begin
result:=false;
end;
freedtm(DoWeRoll);
end;
procedure Rolling;
begin
if(DaRoll=true)then
begin
repeat
roll:=1+random(100);
if (roll>=58)then
begin
wait(100);
inc(CountW);
typesendexx('green:The roll is -' + inttostr(roll) + '- you won',true);
end else
begin
wait(100);
inc(CountL);
typesendexx('red:The roll is -' + inttostr(roll) + '- you lost',true);
end;
inc(count);
inc(counter);
wait(500);
until(count=1);
end else
begin
wait(10)
end;
if(DaTotal=true)then
begin
TypeSendexx('white:Total rolls: ' + IntToStr(Counter) + ' - Total wins: ' + IntToStr(CountW) + ' - Total loss: ' + inttostr(CountL),true);
end;
end;
begin
cleardebug;
wait(2000);
repeat
cleardebug;
count:=0
rolling;
until(iskeydown(27));
end.