User Control Panel
Advertisements

HELP US, HELP YOU!

Russian roulette

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
MxT
Young One
Young One


Joined: 26 Nov 2005
Posts: 65

Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7

PostPosted: Wed Dec 07, 2005 12:01 am    Post subject: Russian roulette Reply with quote

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
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Dec 07, 2005 12:04 am    Post subject: Reply with quote

Well done on one of your first commands Smile.
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
MxT
Young One
Young One


Joined: 26 Nov 2005
Posts: 65

Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7

PostPosted: Wed Dec 07, 2005 12:07 am    Post subject: Thank u Reply with quote

Thank u darkmonkey
Back to top
blostorm
Newbie
Newbie


Joined: 14 Feb 2005
Posts: 14

Reputation: 15.2Reputation: 15.2

PostPosted: Fri Jan 13, 2006 12:41 am    Post subject: Reply with quote

Very good cash winner for shop... Laughing
Back to top
alienz
Almost An Agent
Almost An Agent


Joined: 22 Mar 2004
Posts: 1436
Location: Mars
Reputation: 55.7

PostPosted: Fri Jan 13, 2006 7:57 pm    Post subject: Reply with quote

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
Young One


Joined: 26 Nov 2005
Posts: 65

Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7Reputation: 6.7

PostPosted: Fri Jan 13, 2006 10:32 pm    Post subject: thank u Reply with quote

Thank you alienz Smile
Back to top
munsieman
Newbie
Newbie


Joined: 14 Dec 2006
Posts: 1


PostPosted: Thu Dec 14, 2006 10:19 pm    Post subject: Reply with quote

i like it...i like it alot
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Fri Dec 15, 2006 3:04 pm    Post subject: Reply with quote

Good for you Shocked
munsieman wrote:
i like it...i like it alot
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group