Star Wars Rpg

By Ghost-writer on Nov 01, 2009

This is the star wars rpg, this is the sequal to my harry potter idea :P. To work it you type !start or in the on load enter your owners name and then type !help game for any extra help,

its 100% inis and 0 variables because in my last harry potter script everyone didnt like the massive use of variables,

the ini may get to big so i used writeini -n so if its over 64k thats your problem :)

I fixed a bug for people with [] in there name were $ini(star.ini, person, 0) would return $null, im pretty sure thats khalids job but i found a way around it :P.

To test out the bot: server -m irc.swiftirc.net -j #darkness - Galaxybot.

on $*:TEXT:/^[!@.]Unset/Si:*:{
  if ( $nick == %owner) {
    msg $chan The Duel between %duel.player1 & %duel.player2 has been unset!
    unsetduel
  }
}
on *:load: load

;Alien load - Do not edit.

alias load {
  set %owner $$?"What is the nick of the owner of this bot."
  set -u3 %nick %owner
  setmoney %owner  
  .remove alien.txt
  write alien.txt You start fighting aliens in mission 2
  write alien.txt To fight an alien you type !attack and the attack goes threw
  write alien.txt You can only attack once every 6-12 seconds because it takes your guns a while to reload
  write alien.txt Once you kill an alien they give a cash reward.
  .remove help.txt
  write help.txt Hello, Thank you for using the Star Wars Alien game.
  write help.txt To use this join a big channel and have users type !start
  write help.txt For any questions or bugs you can go to irc.swiftirc.net -j #darkness
  write help.txt For help running the game go to the same place, to edit things directly type //run star.ini
  write help.txt You may change some lines of code but please do not claim the idea as your own.
  write help.txt Give credit when needed - Enjoy using this bot. - Termz
  var %x 1
  echo -a 14>>>>>>>>>>>>>>3Alien Script V1.014<<<<<<<<<<<<<<<
  while (%x < $lines(help.txt)) {
    .timer -o 1 $calc(%x * 3) echo -a $read(help.txt, %x)
    inc %x
  }
}
on $*:TEXT:/^[!@.]Duelcmd/Si:*:{
  msg $nick !@. Can be used with all of these commands.
  msg $nick The duel commands for the weapons are Basic Launcher: !Shoot - Turbo cannon: !Turbo - Flame turrent: !Fire.
}
;Duel interface - Important - edittable
on $*:TEXT:/^[!@.]Duel/Si:#:{
  if (!%duel) {
    if ($readini(star.ini, $nick, mission) >= 2) {
      if (!$readini(star.ini, $nick, Fight)) {
        if (!%Duel.player1) {
          set %Duel.p1hp $readini(star.ini, $nick, Bhp)
          set %Duel.player1 $nick
          writeini star.ini $nick Fight Active
          set %Duel.power1 $readini(star.ini, $nick, power)
          msg $chan $nick has declared a starship duel! To fight him type !duel.
          .timerduel -o 1 20 unsetduel          
          halt
        }
        if (!%duel.player2) {
          .timerduel off
          set %duel Progress
          writeini star.ini $nick Fight Active
          set %Duel.p2hp $readini(star.ini, $nick, Bhp)
          set %Duel.player2 $nick
          set %Duel.power2 $readini(star.ini, $nick, power)
          msg $chan $nick has accepted %Duel.player1 $+ 's duel! You may now fight!
          .notice %Duel.player1 @duelcmds for commands on how to fight
          .notice %duel.player2 @duelcmds for commands on how to fight
          set %turn $rand(1,2)
          msg $chan it is %duel.player [ $+ [ %turn ] ] $+ 's Turn!
        }
      }
      else { .msg $nick You are currently in a fight! }
    }
    else { msg $nick You have not done all the required missions yet! }
  }
}
;start - Non/important - edittable
on $*:TEXT:/^[!@.]start/Si:*:{
  set -u2 %nick $nick
  set -u3 %chan $chan
  setmoney
}
;missions - Important - edittable
on $*:TEXT:/^[!@.]mission/Si:*:{
  if ($2 == complete) {
    if ($readini(star.ini, $nick, mission) == 1) {
      if ($readini(star.ini, $nick, itemore) >= 50) {
        var %ore $readini(star.ini, $nick, itemore)
        dec %ore 5
        var %money $readini(star.ini, $nick, money)
        inc %money 500
        writeini star.ini $nick mission 2
        msg $nick You have completed the mission! and with the completion of the mission you get 500 dollars!
        halt
      }
      else { .notice $nick You do not yet have 5 ore. }
    }
    elseif ($readini(star.ini, $nick, mission) == 2) {
      if $readini(star.ini, $nick, Aliensk) >= 4) {
        var %money $readini(star.ini, $nick, Money)
        inc %money 5000
        msg $nick You have completed the mission and killed 5 aliens! Good job, i always knew you would be worthwhile!
        describe $nick Gives you 5000 dollars to spend as you wish.
        writeini -n star.ini $nick Money %money
        writeini -n star.ini $nick mission 3
        halt
      }
      else { .notice $nick You have not killed 5 aliens yet, You have only killed $readini(star.ini, $nick, Aliensk) aliens. }
    }
  }
  if (!$readini(star.ini, $nick, mission)) {
    msg $nick You have come for a mission eh? Well as your first mission get me 50 ore.
    msg $nick When You are done type !mission complete
    writeini -n star.ini $nick mission 1  
  }
  if ($readini(star.ini, $nick, mission) == 2) {
    msg $nick Come back for another mission did you? Well here it is.
    msg $nick Kill 5 aliens by using the !fight alien command.
    msg $nick if you need any more help to !help alien
  }
  else { .notice $nick you have currently completed all the missions. }
}
;alien killing - important - Edittable
on $*:TEXT:/^[!@.]attack/Si:*:{
  if ($readini(star.ini, $nick, Fighting) == alien) {
    if (!$readini(star.ini, $nick, Attacking)) {
      var %alienhp $readini(star.ini, $nick, alienhp)
      var %hit $calc($readini(star.ini, $nick, power) + $rand(5,15))
      dec %alienhp %hit
      writeini -n star.ini $nick alienhp %alienhp
      if ( %alienhp <= 0 ) {
        var %money $readini(star.ini, $nick, Money)
        inc %money 1000
        writeini -n star.ini $nick Money %money
        msg $nick You have killed the alien earning you 1000 dollars!
        var %aliensk $readini(star.ini, $nick, Aliensk)
        inc %aliensk
        writeini -n star.ini $nick aliensk %aliensk
        remini star.ini $nick attacking
        remini star.ini $nick fighting
        remini star.ini $nick alienhp
        .timeralien $+ $nick off
        msg $nick You have now killed a total of %aliensk aliens And have a total of %money dollars!
      }
      else {
        writeini -n star.ini $nick Attacking 1
        var %time $rand(5,12)
        .timer $+ $nick $+ Attacking -o 1 %time remini star.ini $nick attacking
        msg $nick You have attacked the alien dealing %hit damage, Please wait %time seconds for your next attack, The alien now has %alienhp health left.
      }
    }
    else { .notice $nick You are currently attacking! }
  }
  else { .notice $nick You are not currently fighting }
}
;Alien alias - Important - Edittable
alias alien {
  if (!$server) halt
  var %damage $rand(1,20)
  var %hp $readini(star.ini, $1, Health)
  dec %hp %damage
  msg $1 The alien has hit you causing %damage damage!
  writeini -n star.ini $1 Health %hp
  if ( %hp <= 0) {
    .timeralien $+ $1 off
    var %loss $rand(100,400)
    if (%loss > $readini(star.ini, $1, Money)) {
      writeini -n star.ini $1 Money 0
    }
    else { 
      var %money $readini(star.ini, $1, money)
      dec %money %loss
      writeini -n star.ini $1 Money %money
      msg $1 The alien has killed you, You have lost %loss dollars! and now have $readini(star.ini, $1, money) Dollars.
    }
  }
}

;Fight command - Important - Edittable
on $*:TEXT:/^[!@.]Fight/Si:*:{
  var %hp $readini(star.ini, $nick, Health)
  if ( %hp > 0) {
    if ($2 == alien) {
      if ($readini(star.ini, $nick, mission) >= 2) {
        if (!$readini(star.ini, $nick, Fighting)) {
          msg $nick You have started fighting an alien! use !attack to attack it!
          .timeralien $+ $nick -o 0 $rand(5,15) alien $nick
          writeini -n star.ini $nick fighting Alien
          writeini -n star.ini $nick AlienHp 100
        }
        else { .notice $nick You are currently fighting an alien, use !attack to attack it! }
      }
      else { .notice $nick You have not met the requirements to do this yet. }
    }
    else { .notice $nick The command is Fight <monster>! }
  }
  else { .notice $nick You do not have enough health to fight an alien }
}

on $*:TEXT:/^[!@.]item/Si:*:{
  $iif(@ isin $1,msg $chan,notice $nick) You currently have $item($nick)
}
;item command - Crucial - Non edditable
alias item {
  var %a 1
  while ($ini(star.ini,$1,%a)) { 
    if (item isin $v1) { 
      var %b $addtok(%b,$readini(star.ini,$1,$v2) $remove($v2,item),44) 
    }
    inc %a 
  } 
  return $iif(%b,$replace($v1,$chr(44), $chr(32) $+ - $+ $chr(32)),No items.)
}
;Help command - Edittable
on $*:TEXT:/^[!@.]Help/Si:*:{
  if ( $2 == game ) { 
    msg $nick This is a star wars game, you can mine and sell your ore for items at the bay & do missions via the !mission command.
    .timer 1 1 msg $nick Commands are, Mine <ore>. Buy <item>. Sell <item>. Stats. Money. Bay. Ship. Mission. Mission Complete.
    halt  
  }
  if ( $2 == alien ) {
    play $nick alien.txt 2000
    halt
  }
  if ( mine isin $2 ) {
    .notice $nick to mine you type @mine ore
    .notice $nick The ores are as fallowed: Basic ore, Refrenced to Ore. Gold, Refrenced to Gold.
    .notice $nick When mining ores you might come across gems such as rubies or diamonds
    .notice $nick these are worth a lot so its best to sell them via the @sell <item> command!
  }
  else { 
    if ( $nick == %owner ) {
      .notice $nick To unset a duel type !unset - This is a owner only command.
    }
  .notice $nick We do not provide help with that, We provide help with - Game - Alien - Mining - }
}
;Mining - Crucial to game - Edittable
on $*:TEXT:/^[!@.]Mine/Si:*:{
  if (!$readini(star.ini, $nick, Guide)) { notice $nick You do not have an account yet, Type !bay to get started. | halt }
  if ( $2 == ore ) {
    var %hp $readini(star.ini, $nick, Health)
    var %money ($readini(star.ini, $nick, Health)
    if ( %hp > 0 ) {
      var %chance $rand(1,3)
      if ( %chance != 1) {
        Var %schance $rand(1,10)
        if (%schance == 5) {
          var %rubys $readini(star.ini, $nick, itemRuby)
          inc %rubys
          writeini -n star.ini $nick itemRuby %rubys
          .timer 1 3 msg $nick You have also found a ruby!
        }
        var %ore $rand(5,10)
        inc %ore $readini(star.ini, $nick, ship)
        var %tore $readini(star.ini, $nick, itemore)
        inc %tore %ore
        writeini -n star.ini $nick itemore %tore
        msg $nick You have went on a mining trip and successfully come back with %ore ore! You currently have %tore ore.
      }
      if ( %chance == 1 ) {
        var %hp $readini(star.ini, $nick, Health)
        var %loss $rand(25,35)
        var %power $iif($readini(star.ini, $nick, Power) > 20,20,$readini(star.ini, $nick, Power))
        dec %loss %power
        dec %hp %loss
        writeini -n star.ini $nick Health %hp
        msg $nick You have been attacked while mining the ore, You have lost %loss hp!
        msg $nick $iif(%hp <= 0,You need to go to the bay to get healed!,You have %hp hp left.)
        halt      
      }
    }
    else msg $nick You do not have enough Health to mine for ore! 
  }
  if ( $2 == Gold ) {
    var %hp $readini(star.ini, $nick, Health)
    var %money ($readini(star.ini, $nick, Health)
    if ( %hp > 0 ) {
      var %chance $rand(1,3)
      if ( %chance != 1) {
        Var %schance $rand(1,10)
        if (%schance == 5) {
          var %diamond $readini(star.ini, $nick, itemdiamond)
          inc %diamond
          writeini -n star.ini $nick itemDiamond %diamond
          .timer 1 3 msg $nick You have also found a diamond!
        }
        var %ore $rand(5,10)
        inc %ore $readini(star.ini, $nick, ship)
        var %tore $readini(star.ini, $nick, itemgold)
        inc %tore %ore
        writeini -n star.ini $nick itemgold %tore
        msg $nick You have went on a mining trip and successfully come back with %ore gold ore! You currently have %tore golden ore.
      }
      if ( %chance == 1 ) {
        var %hp $readini(star.ini, $nick, Health)
        var %loss $rand(155,275)
        dec %loss $iif($readini(star.ini, $nick, aliensk) > 20,20,$readini(star.ini, $nick, aliensk))
        var %power $iif($readini(star.ini, $nick, Power) > 20,20,$readini(star.ini, $nick, Power))
        dec %loss %power
        dec %hp %loss
        writeini -n star.ini $nick Health %hp
        msg $nick You have been attacked while mining the golden ore, You have lost %loss hp!
        msg $nick $iif(%hp <= 0,You need to go to the bay to get healed!,You have %hp hp left.)
      }
    }
    else msg $nick You do not have enough Health to mine for ore! 
  }
  else msg $nick What do you want to mine? The command is mine <Ore>. & you can only mine gold and plain ore.
}
;stats command - edittable
on $*:TEXT:/^[!@.]Stats/Si:#:{
  var %person $iif($2,$strip($2),$nick)
  if ($readini(star.ini, %person $+ , Guide)) { 
    $iif(@ isin $1,msg $chan,.notice %person $+ ) 14 $+ %person currently has a12 $ship( $+ %person $+ ) - $money( $+ %person $+ ) Dollars14 And12 $hp( $+ %person $+ ) 14With12 $weapon( $+ %person $+ ) Equipped.
  }
  else { .notice $nick $iif(!$2,You,%person) does not have an account yet, type !start to get one! }
}
;Money - Important to game. - non edittable
alias money {
  var %x $readini(star.ini, $1, money)
  if (!%x) var %x 0
  return %x
}
;Weapon - important to game. - non edittable
alias weapon {
  var %x $ini(star.ini, $replace($1,$chr(91),~,$chr(93),~), 0)
  while (%x) {
    if ( Weapon isin $ini(star.ini, $replace($1,$chr(91),~,$chr(93),~), %x)) {
      var %b $iif(%b, $+ %b 14-12, %b) $readini(star.ini, $1, $ini(star.ini, $replace($1,$chr(91),~,$chr(93),~), %x))
    }
    dec %x
  }
  return Weapons: $iif(%b,%b,0)
}

alias hp {
  var %x $readini(star.ini, $1, Health)
  if (!%x) var %x No Health
  return %x Hp
}

alias ship {
  var %x $readini(star.ini, $1, shipn)
  if (!%x) var %x No ship
  return %x
}
on $*:TEXT:/^[!@.]Ship/Si:#:{
  if ($readini(Star.ini, $nick, ship)) $iif(@ isin $1,msg $chan,notice $nick) $nick has a $ship($nick) $iif($readini(star.ini, $nick, Weapon1), With $weapon($nick) equiped))
  else $iif(@ isin $1,msg $chan,notice $nick) $nick Does not have a ship, to get one go to the bay.
} 
;Heal command, /heal person
alias heal {
  if (!$server) halt
  writeini -n star.ini $1 Health $iif($readini(star.ini, $1, Bhp),$v1,100)
  msg $1 You now have $iif($readini(star.ini, $1, Bhp),$v1,100) Health!
}
;The bay, Our prices only go up!
on $*:TEXT:/^[!@.]Bay/Si:*:{
  if (!$readini(star.ini, $nick, Guide)) { 
    set -u2 %nick $nick
    set -u2 %chan $chan
    setmoney
  }
  else {
    var %hp $readini(star.ini, $nick, Health)
    if ( %hp !> 0) { 
      msg $nick oh no! You have no hp, please wait while i heal you! it will take 20 seconds!
      .timer $+ $nick -o 1 20 heal $nick
      halt
    }
    msg $nick Hello $nick $+ , Welcome to they ship bay, What would you like to buy?
    msg $nick In stock we currently have,
    msg $nick 14- 4Galaxy Cruiser3 $bytes(10000,db) dollars. 14-
    msg $nick 14- 12Phase ship3 25000 dollars. 14-
    msg $nick 14- 12Flame turrent3 12500 dollars. 14-
    msg $nick 14- 12Turbo Star Ship3 1000 dollars. 14-
    msg $nick 14- 12Super Cannons3 150 dollars. 14-
    msg $nick 14- 12Health packs3 50 dollars. 14-
    msg $nick To buy any of these products just type !buy <product>.
    msg $nick We also buy items! type !shop <item> to see them!
  }
}
on $*:TEXT:/^[!@.]shop/Si:*:{
  if ( $2 == gold ) { msg $nick yes we buy gold for 500 a piece! | halt }
  if ( $2 == ore ) { msg $nick yes we buy ore, plain ore<25> and golden ore<500>! | halt }
  if ( Diam isin $2 ) { msg $nick Yes, we buy diamond! | halt }  
  if ( rub isin $2 ) { msg $nick yes we buy rubies! | halt }
  .msg $nick no we do not buy that we only buy Rubies, Diamonds, Golden ore, Plain ore. To sell them type !sell <amount> <item>
}
;sell command
on $*:TEXT:/^[!@.]sell/Si:*:{
  if $strip($2 isnum) && ( diamon isin $strip($3) ) {
    var %j $readini(star.ini, $nick, itemdiamond)
    if ( %j >= $2 ) {
      dec %j $2
      var %money $readini(star.ini, $nick, money)
      inc %money $calc($2 * 5000)
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick itemdiamond %j
      msg $nick You have sold $2 piec $+ $iif($2 > 1,es,e) of golden ore for $calc($2 * 5000) dollars, You now have %j diamon $+ $iif($2 != 1,ds,d) and $bytes(%money,db) dollars.
    }
    else { .notice $nick you do not have that many diamonds, You have $iif(%j,%j,0) diamonds. }
  }

  if $strip($2 isnum) && ( $strip($3) == gold ) {
    var %ore $readini(star.ini, $nick, itemgold)
    if ( %ore >= $2 ) {
      dec %ore $2
      var %money $readini(star.ini, $nick, money)
      inc %money $calc($2 * 500)
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick itemgold %ore
      msg $nick You have sold $2 piec $+ $iif($2 > 1,es,e) of golden ore for $calc($2 * 500) dollars, You now have %ore ore and $bytes(%money,db) dollars.
    }
    else { .notice $nick you do not have that much golden ore, You only have %ore ore. }
  }
  if $strip($2 isnum) && ( $strip($3) == ore ) {
    var %ore $readini(star.ini, $nick, itemore)
    if ( %ore >= $2 ) {
      dec %ore $2
      var %money $readini(star.ini, $nick, money)
      inc %money $calc($2 * 25)
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick itemore %ore
      msg $nick You have sold $2 ore for $calc($2 * 25) dollars, You now have %ore ore and $bytes(%money,db) dollars.
    }
    else { .notice $nick you do not have that much ore, You only have %ore ore. }
  }
  if ( $2 isnum ) && ( rub isin $3) {
    var %ruby $readini(star.ini, $nick, itemRuby)
    if ( %ruby >= $2 ) {
      dec %ruby $2
      var %money $readini(star.ini, $nick, money)
      inc %money $calc($2 * 100)
      writeini -n star.ini $nick itemRuby %ruby
      writeini -n star.ini $nick Money %money
      msg $nick You have sold $iif($2 != 1, $2 rubies, a ruby) and recieved $calc($2 * 100) dollars!
    }
    else { .notice $nick You do not have that many rubies. }
  }
}
;Buy command - everything.
on $*:TEXT:/^[!@.]Buy/Si:*:{
  if ( Galax isin $strip($2)) && ( Cruise isin $2-) {
    var %money $readini(star.ini, $nick, money)
    if ( $readini(star.ini, $nick, money) >= 10000 ) {
      msg $nick You have purchased a Galaxy Cruiser! One of the finest there are!
      dec %money 10000
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick bhp 500
      writeini -n star.ini $nick Health 500
      writeini -n star.ini $nick Shipn Galaxy Cruiser
      writeini -n star.ini $nick Ship 5
      msg $nick You currently have $bytes(%money,db) dollars.
    }
    else { msg $nick You do not have enough money to buy a Phase Ship, You currently have $iif(%money,%money dollars.,No money) }
  }
  if ( flam isin $strip($2)) && ( Turren isin $strip($3) ) {
    var %money $readini(star.ini, $nick, money)
    if ( %money >= 12500) {
      dec %money 12500
      writeini -n star.ini $nick Money %money
      var %power $readini(star.ini, $nick, Power)
      inc %power 20
      writeini -n star.ini $nick Power $iif(%power >= 65,65,%power)
      msg $nick You have purchased a flame turrent!
      msg $nick You have %money dollars left.
      writeini -n star.ini $nick Weapon2 Flame Turrent
    }
    else { .notice $nick You do nto have enough money to buy a flame turrent, You currently have $iif(%money,%money dollars.,No money) }
  }
  if ( phase isin $strip($2)) && ( ship isin $2-) {
    var %money $readini(star.ini, $nick, money)
    if ( $readini(star.ini, $nick, money) >= 25000 ) {
      msg $nick You have purchased a Phase Ship! One of the finest there are!
      dec %money 25000
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick bhp 200
      writeini -n star.ini $nick Health 200
      writeini -n star.ini $nick Shipn Phase Ship
      writeini -n star.ini $nick Ship 3
      msg $nick You currently have $bytes(%money,db) dollars.
    }
    else { msg $nick You do not have enough money to buy a Phase Ship, You currently have $iif(%money,%money dollars.,No money) }
  }
  if ( Turbo isin $strip($2)) && ( Ship isin $2-) {
    var %money $readini(star.ini, $nick, money)
    if ( $readini(star.ini, $nick, money) >= 1000 ) {
      msg $nick You have purchased a Turbo Star Ship!
      dec %money 1000
      writeini -n star.ini $nick Shipn Turbo Star Ship
      writeini -n star.ini $nick ship 2
      writeini -n star.ini $nick money %money
      msg $nick You currently have %money dollars.
    }
    else { msg $nick You do not have enough money to buy a turbo star ship, You have $iif(%money,%money dollars.,No money) }
  }
  if ( Cannon isin $strip($2-)) && ( Super isin $strip($1-) ) {
    var %money $readini(star.ini, $nick, money)
    if (%money >= 150) {
      dec %money 150
      writeini -n star.ini $nick money %money
      writeini -n star.ini $nick Weapon1 Turbo Cannon
      writeini -n star.ini $nick Power 20
      msg $nick You have bought a Turbo cannon!
      msg $nick You currently have %money dollars left.
    }
    else { msg $nick You do not have enough money to buy a Turbo cannon, You have $iif(%money,%money dollars.,No money) }
  }
  if ( Health isin $strip($2-)) && ( pack isin $2-) {
    var %money $readini(star.ini, $nick, money)
    if (%money >= 50) {
      dec %money 50
      var %health $readini(star.ini, $nick, health)
      inc %health 20
      writeini -n star.ini $nick Health %health
      writeini -n star.ini $nick money %money
      msg $nick You have bought 20 health, you now have %health health points.
    }
    else { .notice $nick You do not have enough money to buy a health pack, You have $iif(%money,%money dollars.,No money) }
  }
}
;Begging settings command.
alias setmoney {
  if (!%nick) && (!$1) { echo -a Insufficent perimeters, Setmoney <Person> | halt }
  if (!%nick) var %nick $1
  if (!$address(%nick,3)) { goto quick }
  if ($readini(star.ini, Accounts, $address(%nick,3))) { notice %nick You already have an account under the nick $readini(star.ini, Accounts, $address(%nick,3)) $+ , Ask %owner if you want it deleted. | halt }
  writeini star.ini Accounts $address(%nick,3) %nick
  :quick
  if (!$readini(star.ini, %nick $+ , Guide)) { 
    writeini -n star.ini %nick Ship 1
    writeini -n star.ini %nick shipn Basic Star Fleet
    writeini -n star.ini %nick Money 500
    writeini -n star.ini %nick Guide Completed
    writeini -n star.ini %nick Power 5
    writeini -n star.ini %nick Health 100
    writeini -n star.ini %nick bhp 100
    writeini -n star.ini %nick Weapon0 Basic launcher
    if (!$server) { echo -a You are not connected so we could not message %nick about his new joining. | halt }
    msg %nick Welcome to the star galaxy %nick $+ . It will be a pleasure to fight along side you.
    msg %nick I have given you 500 dollars & A Basic star fleet. 
    msg %nick For help on how to play the game type !help Game
  }
}
on $*:TEXT:/^[!@.]Money/Si:#:{
  set -u2 %nick $nick
  set -u2 %chan $chan
  var %money $readini(star.ini, $nick, money)
  $iif($readini(star.ini, $nick, Money), $iif(@ isin $1,msg $chan,notice $nick) You currently have %money dollars, setmoney)
}
;Fire Command - #1

on $*:TEXT:/^[!@.]Fire/Si:#:{
  if ($readini(star.ini, $nick, weapon2)) {
    if (%duel) {
      if ( $nick == %duel.player1 ) {
        if ( %turn == 1 ) {
          var %damage $rand(30,50)
          dec %Duel.p2hp %damage
          msg $chan 4,15 $+ $nick has shot %duel.Player2 $+ 's ship with a fire turrent causing %damage damage!
          set %turn 2
          if ( %Duel.p2hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player1 Has killed %duel.Player2 $+ !
            msg $chan %duel.Player1 has won %win dollars from killing %duel.player2 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight
            unset %due*
          }
          else { msg $chan 4,15 $+ %duel.Player2 has %Duel.p2hp hp left, it is now %duel.Player2 $+ 's turn! }
        }
      }
      if ( $nick == %duel.player2 ) {
        if ( %turn == 2 ) {
          var %damage $rand(30,50)
          dec %Duel.p1hp %damage
          msg $chan 4,15 $+ $nick has shot %duel.Player1 $+ 's ship with a fire turrent causing %damage damage!
          set %turn 1
          if ( %Duel.p1hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player2 Has killed %duel.Player1 $+ !
            msg $chan %duel.Player2 has won %win dollars from killing %duel.player1 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight
            unset %due*
          }
          else { msg $chan 4,15 $+ %duel.Player1 has %Duel.p1hp hp left, it is now %duel.Player1 $+ 's turn! }
        }
      }
    }
    else { .notice $nick There is currently no duel in progress. }
  }
  else { .notice $nick You do not have this weapon! }
}
;Turbo command - #2

on $*:TEXT:/^[!@.]Turbo/Si:#:{
  if ($readini(star.ini, $nick, weapon1)) {
    if (%duel) {
      if ( $nick == %duel.player1 ) {
        if ( %turn == 1 ) {
          var %damage $rand(20,40)
          dec %Duel.p2hp %damage
          msg $chan 12,15 $+ $nick has shot %duel.Player2 $+ 's ship with their turbo cannons causing %damage damage!
          set %turn 2
          if ( %Duel.p2hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player1 Has killed %duel.Player2 $+ !
            msg $chan %duel.Player1 has won %win dollars for killing %duel.player2 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight
            unset %due*
          }
          else { msg $chan 12,15 $+ %duel.Player2 has %Duel.p2hp hp left, it is now %duel.Player2 $+ 's turn! }
        }
      }
      if ( $nick == %duel.player2 ) {
        if ( %turn == 2 ) {
          var %damage $rand(30,50)
          dec %Duel.p1hp %damage
          msg $chan 12,15 $+ $nick has shot %duel.Player1 $+ 's ship with their turbo cannons causing %damage damage!
          set %turn 1
          if ( %Duel.p1hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player2 Has killed %duel.Player1 $+ !
            msg $chan %duel.Player2 has won %win dollars for killing %duel.player1 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight
            unset %due*
          }
          else { msg $chan 12,15 $+ %duel.Player1 has %Duel.p1hp hp left, it is now %duel.Player1 $+ 's turn! }
        }
      }
    }
    else { .notice $nick There is currently no duel in progress. }
  }
  else { .notice $nick You do not have this weapon! }
}
;Shoot Command - #3

on $*:TEXT:/^[!@.]Shoot/Si:#:{
  if ($readini(star.ini, $nick, weapon0)) {
    if (%duel) {
      if ( $nick == %duel.player1 ) {
        if ( %turn == 1 ) {
          var %damage $rand(5,15)
          Var %damage2 $rand(5,15)
          dec %Duel.p2hp $calc(%damage + %damage2)
          msg $chan 8,14 $+ $nick has shot %duel.Player2 $+ 's ship with their basic shooters causing %damage & %damage2 damage!
          set %turn 2
          if ( %Duel.p2hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player1 Has killed %duel.Player2 $+ !
            msg $chan %duel.Player1 has won %win dollars for killing %duel.player2 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight
            unset %due*
          }
          else msg $chan 8,14 $+ %duel.Player2 has %Duel.p2hp hp left, it is now %duel.Player2 $+ 's turn! 
        }
      }
      if ( $nick == %duel.player2 ) {
        if ( %turn == 2 ) {
          var %damage $rand(5,15)
          Var %damage2 $rand(5,15)
          dec %Duel.p1hp $calc(%damage + %damage2)
          msg $chan 8,14 $+ $nick has shot %duel.Player1 $+ 's ship with their basic shooters causing %damage & %damage2 damage!
          set %turn 1
          if ( %Duel.p1hp <= 0 ) {
            var %money $readini(star.ini, $nick, money)
            var %win $rand(100,500)
            inc %money %win
            writeini star.ini $nick money %money
            msg $chan %duel.player2 Has killed %duel.Player1 $+ !
            msg $chan %duel.Player2 has won %win dollars for killing %duel.player1 and now has %money dollars.
            remini star.ini %duel.player1 fight       
            remini star.ini %duel.player2 fight  
            unset %due*
          }
          else msg $chan 8,14 $+ %duel.Player1 has %Duel.p1hp hp left, it is now %duel.Player1 $+ 's turn! 
        }
      }
    }
    else  .notice $nick There is currently no duel in progress. 
  }
  else  .notice $nick You do not have this weapon! 
}
alias unsetduel {
  remini star.ini %duel.player1 fight       
  remini star.ini %duel.player2 fight  
  unset %due*
}

Comments

Sign in to comment.
Ghost-writer   -  Feb 06, 2010

... When you type start it tells you a command: @Help, You type @Help and there is MORE than enough help there..

 Respond  
The_One_And_Only   -  Feb 05, 2010

@ darkcoder

.remove help.txt
write help.txt Hello, Thank you for using the Star Wars Alien game.
write help.txt To use this join a big channel and have users type !start
write help.txt For any questions or bugs you can go to irc.swiftirc.net -j #darkness
write help.txt For help running the game go to the same place, to edit things directly type //run star.ini
write help.txt You may change some lines of code but please do not claim the idea as your own.
write help.txt Give credit when needed - Enjoy using this bot. - Termz

is not a help file with commands for the users...

 Respond  
DarkCoder   -  Feb 05, 2010

Uhmm, I think there is, on load event it writes help.txt so you probobly need to load it and read..

 Respond  
The_One_And_Only   -  Feb 05, 2010

you should include a help file with the commands for the users...

 Respond  
Pangaea   -  Jan 13, 2010

um, another rpg game with absaloutly no instructions whatsoever how to play

 Respond  
CadetAndrew   -  Nov 21, 2009

This is most impressive! I will definitally have to use it as soon as I can get my mIRC bot back up.

 Respond  
Brownjam0   -  Nov 21, 2009

episodes 1, 3 and 5 are 3 of my favourite, the other 3 favourites are 2, 4 and 6. they need to make more star wars !!!! i might add this to my bot

 Respond  
Atr   -  Nov 02, 2009

Lulz, a Star Wars fighting game - nice :P

 Respond  
sunslayer   -  Nov 01, 2009

@3nigmat1c episode 3 is my fav

 Respond  
Ghost-writer   -  Nov 01, 2009

lol yea, anyone can use it :P.

 Respond  
3nigmat1c   -  Nov 01, 2009

Strong I am, but slayer of suns, which movie talk you of?

 Respond  
sunslayer   -  Nov 01, 2009

Only a nerd would make a pointless script of a pointless movie.the greatest movie of all time, Star Wars is

 Respond  
3nigmat1c   -  Nov 01, 2009

Hey this looks cool, can I use it?

 Respond  
Grant-   -  Nov 01, 2009

Only a nerd would make a pointless script of a pointless movie.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.