Howdy, I hope this is the correct forum to post in.

I'm interested in some little codes you're proud of, and I'll be willing to help with anything you need, just ask.

Looking forward to it.

Recommended Answers

All 3 Replies

I'll get the ball rolling.
Here's a small example of a tiny tiny extremely basic russian-roulette-if-you-lose-you-get-kicked script.
Requirements: logged on bot with +o/op powers.

First part, is the "change RR on or off".

on !*:TEXT:!RR *:#:{
  if (($nick == Kiel)) { set %RRONOFF $2 {
      if ((%RRONOFF == ON)) { //msg $chan 12Roulette is now4 ON12. There are 6 chambers in this kick-gun, type "4!spinRR12" to take your chances. Land on the bullet chamber and you get kicked. }
      ELSE { //msg $chan 12 Roulette is now4 $2 $+ 12. }
    }
  }
}

Second part, is the RR.

on !*:TEXT:!spinRR:#:{
  if ((%RRONOFF == ON)) {
    %RRNum = $rand(1,6) | {
      if ((%RRNum == 1)) { //msg $chan 12Sorry4 $nick $+ 12, you've hit the bullet chamber. Bye bye. | //kick $chan $nick Bullet chamber! }
      ELSE { //msg $chan 12You didn't land on the bullet chamber this time4 $nick $+ 12, but spin again, I dare ya'. }
    ELSE { //msg $chan 12Sorry4 $nick $+ 12, but 4Roulette 12is not enabled. Please ask 4Kiel12 to enable it. } }
  }
}

gr8 amazing usage of nested if statement of mirc scripting... maybe you'll move up to l337 bot progamming next... this is basic hello world if statements zzz

gr8 amazing usage of nested if statement of mirc scripting... maybe you'll move up to l337 bot progamming next... this is basic hello world if statements zzz

;;Kiel's Casino 2005
on !*:TEXT:!Create User:#:{
  if ((% [ $+ [ $nick ] $+ ] .savings == $null)) { set % [ $+ [ $nick ] $+ ] .savings 100 | //msg $chan 12A Savings Account with4 $ $+ 10012 has been created for4 $nick $+ 12. }
  if ((% [ $+ [ $nick ] $+ ] .money == $null)) { set % [ $+ [ $nick ] $+ ] .money 90 | //msg $chan 12Kiel's Casino has given4 $ $+ 9012 to4 $nick $+ 12. }
}

on !*:TEXT:!TakeMoney *:#:{
  if (($nick == Kiel)) {
    if (($4 = $null)) { dec % [ $+ [ $2 ] $+ ] .money $3 | //msg $chan 4Kiel12 has taken4 $ $+ $3 12from4 $2 12for no reason. }
    ELSE { dec % [ $+ [ $2 ] $+ ] .money $3 | //msg $chan 4Kiel12 has taken4 $ $+ $3 12from4 $2 $+ 12, reason:4 $4- }
  }
}

on !*:TEXT:!GiveMoney *:#:{
  if (($nick == Kiel)) {
    if (($4 = $null)) { inc % [ $+ [ $2 ] $+ ] .money $3 | //msg $chan 4Kiel12 has given4 $ $+ $3 12to4 $2 12for no reason. }
    ELSE { inc % [ $+ [ $2 ] $+ ] .money $3 | //msg $chan 4Kiel12 has given4 $ $+ $3 12to4 $2 $+ 12, reason:4 $4- }
  }
}

on !*:TEXT:!Withdraw *:#:{
  if ((% [ $+ [ $nick ] $+ ] .savings >= $2)) { inc % [ $+ [ $nick ] $+ ] .money $2 | dec % [ $+ [ $nick ] $+ ] .savings $2 | //msg $chan 4 $ $+ $2 12has been withdrawn from your Savings Account,4 $nick $+ 12. | //notice $nick Account Balance: % [ $+ [ $nick ] $+ ] .money - Savings Account Balance: % [ $+ [ $nick ] $+ ] .savings | halt }
  ELSE { //msg $chan 12Sorry4 $nick $+ 12, your Savings Account does not hold enough money to withdraw4 $ $+ $2 $+ 12. Your Savings Account currently holds4 $ $+ % [ $+ [ $nick ] $+ ] .savings | halt }
}

on !*:TEXT:!Deposit *:#:{
  if ((% [ $+ [ $nick ] $+ ] .money >= $2)) { dec % [ $+ [ $nick ] $+ ] .money $2 | inc % [ $+ [ $nick ] $+ ] .savings $2 | //msg $chan 4 $ $+ $2 12has been deposited into your savings account,4 $nick $+ 12. | //notice $nick Account Balance: % [ $+ [ $nick ] $+ ] .money - Savings Account Balance: % [ $+ [ $nick ] $+ ] .savings | halt }
  ELSE { //msg $chan 12Sorry4 $nick $+ 12, you're not holding enough money to deposit4 $ $+ $2 12into your savings account. You're currently holding4 $ $+ % [ $+ [ $nick ] $+ ] .money | halt }
}

on !*:TEXT:!ATM:#:{
  if ((% [ $+ [ $nick ] $+ ] .savings == $null)) { //msg $chan 12You do not own a Savings Account4 $nick $+ 12. Please type4 !Create User12 to make one. }
  ELSE { //msg $chan 4 $+ $nick $+ 12's Savings Account Balance:4 $ $+ % [ $+ [ $nick ] $+ ] .savings }
}

on !*:TEXT:!Wallet:#:{
  if ((% [ $+ [ $nick ] $+ ] .money == $null)) { //msg $chan 12You do not yet have a Casino Wallet4 $nick $+ 12. Please type 4!Create User12, and Kiel's Casino will create one for you, plus give you4 $ $+ 9012. If you seek financial aid, please ask 4Kiel12. }
  ELSE { //msg $chan 4 $+ $nick $+ 12's wallet currently holds:4 $ $+ % [ $+ [ $nick ] $+ ] .money }
}

on !*:TEXT:!KCGL:#: //notice $nick Games List: 4Numbers12 - 1 in 2 chance of winning. Max4 $ $+ 100 12bet. 4Broke12 - A game where you can win4 $ $+ 1012, but only playable if you have no money.4 ATM12 - Type 4!ATM12 or 4!Wallet12 to check your current account balance and money held. | //notice $nick 4Roulette12 - Minimum4 $ $+ 100 12bet, pay off is a huge 10 to 1. } }

on !*:TEXT:!Casino *:#:{
  if (($nick == Kiel)) {
    set %CasinoOnOff $2 {
      if ((%CasinoOnOff == open)) { //msg $chan 4Kiel's Casino 14(Version 2.0)12 is now open for business! Type4 !Gamble <game> <amount to bet> 12to play. For a list of games, type4 !KCGL12. This listing service is only available when the Casino is open. If this is your first time playing, you need to create your username. Type4 !Create User 12to do so. }
      if ((%CasinoOnOff == closed)) { //msg $chan 4Kiel's Casino12 is now closed temporarily. Please ask him to re-open it for business. }
      if ((%CasinoOnOff == Under-Construction)) { //msg $chan 4Kiel's Casino12 is now open for business, but currently under heavy construction. Only some games, if any at all, are available.
      }
    }
  }
}

on !*:TEXT:!Gamble *:#:{
  if (($2 == Roulette)) {
    if ((% [ $+ [ $nick ] $+ ] .money < $3)) || ((% [ $+ [ $nick ] $+ ] .money == $null)) { //msg $chan 12Sorry4 $nick $+ 12, you don't have enough money to bet4 $ $+ $3 $+ 12. If you have no money, please type4 !Gamble Broke12 for a no-cost chance of winning4 $ $+ 1012. If you have some money, gamble with a lower amount. If this is your first time at Kiel's Casino, please type 4!Create User12. To check your current amount of money you have, type4 !ATM 12or4 !Wallet12. | halt }
    ELSE {
      if (($3 < 100)) { //msg $chan 12Sorry4 $nick $+ 12, you must bet at least4 $ $+ 10012 to play this risky game. The pay off is 10 to 1. }
      ELSE { set %TempCasinoVar $3 | %TempCasinoVar = $3 * 10 | %RouletteCasinoVar = $rand(1,10)
        {        
          if ((%RouletteCasinoVar == 10)) { //msg $chan 12You're extremely lucky4 $nick $+ 12! You've just won4 $ $+ %TempCasinoVar $+ 12! | inc % [ $+ [ $nick ] $+ ] .money %TempCasinoVar | halt }
          ELSE { //msg $chan 12Sorry4 $nick $+ 12, you just lost4 $ $+ $3 $+ 12. | dec % [ $+ [ $nick ] $+ ] .money $3 | halt }
  } } } }
  if (($2 == Broke)) {
    if ((% [ $+ [ $nick ] $+ ] .money == $null)) { //msg $chan 12Please type4 !Create User 12to create an account with Kiel's Casino. }
    if ((% [ $+ [ $nick ] $+ ] .money < 1)) { %BrokeCasinoVar = $rand(1,5) } {
      if ((%BrokeCasinoVar == 1)) { //msg $chan 12Congratulations4 $nick $+ 12, you've won4 $ $+ 10.12 Try not to lose all your money again. | halt }
    ELSE { //msg $chan 12Sorry4 $nick $+ 12, this game is only available to those who have an account with no money. | halt } }
  }    
  if (($2 == Numbers)) {
    if (($3 > % [ $+ [ $nick ] $+ ] .money)) || ((% [ $+ [ $nick ] $+ ] .money == $null)) { //msg $chan 12Sorry4 $nick $+ 12, you don't have enough money to bet4 $ $+ $3 $+ 12. Please gamble with a lower amount or create an account using4 !Create User12. To check your current amount of money you have, type4 !ATM12 or 4!Wallet12. | halt }
    ELSE { %NumbersCasinoVar = $rand(1,2) } {
      if (($3 > 100)) { //msg $chan 12Sorry4 $nick $+ 12, you can only bet up to4 $ $+ 10012 on this game. | halt }
      if ((%NumbersCasinoVar == 1)) { //msg $chan 12You're lucky4 $nick $+ 12! You just won4 $ $+ $3 $+ 12! | inc % [ $+ [ $nick ] $+ ] .money $3 | halt }
      ELSE { //msg $chan 12Sorry4 $nick $+ 12, but you lost4 $ $+ $3 $+ 12. | dec % [ $+ [ $nick ] $+ ] .money $3 | halt }
    }
  }
}

Keke.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.