|
| Author |
Message |
MxT Young One

Joined: 26 Nov 2005 Posts: 65
      
|
Posted: Wed Dec 07, 2005 12:01 am Post subject: Russian roulette |
|
|
Hi, Iv made a small games (that already exists) name The russian roulette.
Iv use this command to win money for my shop.....
so there is the code:
| Code: |
if($message eq '!rr')
{
if(-e "./Fichier/Shop/Username/$username/cash.txt")
{
$self->sendMessage("---------Russian roulette---------
To play just type !rr go
If u win, u win 500\$.
If u lose u lose all ur money.
Chance: 1 on 3.");
}
}
if($message =~ /^!rr go/)
{
if(-e "./Fichier/Shop/Username/$username/cash.txt")
{
$self->sendMessage("U take the gun and push the trigger ....");
@pow = ("Head shot ....", "POW !!!!!!!!!!!!!", "KAPOW!!!!!!", "BAM!!!!!!");
@survi = ("U survive.", "Really lucky, u are.");
$rndwin = $survi[int(rand(scalar(@survi)))];
$rndpow = $pow[int(rand(scalar(@pow)))];
$bchoix = int(rand(3)) + 1;
if($bchoix eq 3)
{
$self->sendMessage($rndwin);
$self->sendMessage("U just win 500 \$.");
open(FILE, "<./Fichier/Shop/Username/$username/cash.txt");
$cash = <FILE>;
close(FILE);
$money = $cash + 500;
open(DATA, ">./Fichier/Shop/Username/$username/cash.txt");
print DATA $money;
close(DATA);
}
if($bchoix ne 3)
{
$self->sendMessage($rndpow);
$self->sendMessage("U lose all ur cash.");
open(FICHIER, ">./Fichier/Shop/Username/$username/cash.txt");
print FICHIER 0;
close(FICHIER);
}
}
}
|
|
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Wed Dec 07, 2005 12:04 am Post subject: |
|
|
Well done on one of your first commands . _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
MxT Young One

Joined: 26 Nov 2005 Posts: 65
      
|
Posted: Wed Dec 07, 2005 12:07 am Post subject: Thank u |
|
|
| Thank u darkmonkey |
|
| Back to top |
|
 |
blostorm Newbie

Joined: 14 Feb 2005 Posts: 14
  
|
Posted: Fri Jan 13, 2006 12:41 am Post subject: |
|
|
Very good cash winner for shop...  |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Fri Jan 13, 2006 7:57 pm Post subject: |
|
|
Good job, you should use the right operators for numerical conditions though. NE and EQ are for strings, although in this case it does work because Perl understands what you're trying to do. That and declaring your variables with "my" will stop you from headaches with globals. Using local vars and the proper operators are good Perl coding practices and you should use these techniques wherever possible. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Last edited by alienz on Sat Jan 14, 2006 12:20 am; edited 2 times in total |
|
| Back to top |
|
 |
MxT Young One

Joined: 26 Nov 2005 Posts: 65
      
|
Posted: Fri Jan 13, 2006 10:32 pm Post subject: thank u |
|
|
Thank you alienz  |
|
| Back to top |
|
 |
munsieman Newbie

Joined: 14 Dec 2006 Posts: 1
 
|
Posted: Thu Dec 14, 2006 10:19 pm Post subject: |
|
|
| i like it...i like it alot |
|
| Back to top |
|
 |
mat007 Almost An Agent

Joined: 12 Jan 2004 Posts: 1375
   votes: 2
|
Posted: Fri Dec 15, 2006 3:04 pm Post subject: |
|
|
Good for you
| munsieman wrote: | | i like it...i like it alot |
|
|
| Back to top |
|
 |
|