mIRC Home    About    Download    Register    News    Help

Print Thread
#252903 16/05/15 03:00 PM
L
lonelydevil90
lonelydevil90
L
Hi I'm developing a little rpg game for my twitch channel.

The game shouldn't be so complex, cause I just want to make it easy.

!battle to fight a random monster (win or lose) and get exp. For each level you have an exp number set to level up
!level show your level and exp needed to level up

I'm doing it on mIRC but I really don't know how to start it. No idea where to save exp/level for each viewer and the random monster list. I have to manage when you are supposed to win or lose a battle too.

Hope you have time for a little help, it shouldn't be so long when you know how to do it.

Thank you, Antonio.

Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
Actually even a simple RPG-game wont be made that fast..
And this is a really bad idea to learn scripts with such a game at twitch, cos twitch makes it harder due to some of it`s irc server specific (like time limit for messages, no query, part\join delay).
There were some examples not so far at this forum about simple duel\arena-scripts, you can try to check them.

L
lonelydevil90
lonelydevil90
L
thanks, I'll take a look.

L
lonelydevil90
lonelydevil90
L
These are the two scripts I made. I tried some debug and they should work properly.
I know they are not optimized and it's full of garbage, but I just need them to do their job smile

Can someone take a look and tell me if something's wrong?

Code:
on *:TEXT:!battle:#: {
  if (!%comwait) {
    set -u1 %comwait 1
    var %mob = $rand(1,100)
    if ((%mob == 1) || ($v1 == 2) || ($v1 == 3) || ($v1 == 4) || ($v1 == 5) || ($v1 == 6) || ($v1 == 7) || ($v1 == 8) || ($v1 == 9) || ($v1 == 10)) var %enc = Nothing
    if ((%mob == 11) || ($v1 == 12) || ($v1 == 13) || ($v1 == 14) || ($v1 == 15) || ($v1 == 16) || ($v1 == 17) || ($v1 == 18) || ($v1 == 19) || ($v1 == 20)) var %enc = bat
    if ((%mob == 21) || ($v1 == 22) || ($v1 == 23) || ($v1 == 24) || ($v1 == 25) || ($v1 == 26) || ($v1 == 27) || ($v1 == 28) || ($v1 == 29) || ($v1 == 30)) var %enc = flan
    if ((%mob == 31) || ($v1 == 32) || ($v1 == 33) || ($v1 == 34) || ($v1 == 35) || ($v1 == 36) || ($v1 == 37) || ($v1 == 38) || ($v1 == 39) || ($v1 == 40)) var %enc = goblin
    if ((%mob == 41) || ($v1 == 42) || ($v1 == 43) || ($v1 == 44) || ($v1 == 45) || ($v1 == 46) || ($v1 == 47) || ($v1 == 48) || ($v1 == 49) || ($v1 == 50)) var %enc = bomb
    if ((%mob == 51) || ($v1 == 52) || ($v1 == 53) || ($v1 == 54) || ($v1 == 55) || ($v1 == 56) || ($v1 == 57) || ($v1 == 58)) var %enc = ahriman
    if ((%mob == 59) || ($v1 == 60) || ($v1 == 61) || ($v1 == 62) || ($v1 == 63) || ($v1 == 64) || ($v1 == 65) || ($v1 == 66)) var %enc = basilisk
    if ((%mob == 67) || ($v1 == 68) || ($v1 == 69) || ($v1 == 70) || ($v1 == 71) || ($v1 == 72) || ($v1 == 73)) var %enc = cactuar
    if ((%mob == 74) || ($v1 == 75) || ($v1 == 76) || ($v1 == 77) || ($v1 == 78)) var %enc = tomberry
    if ((%mob == 79) || ($v1 == 80) || ($v1 == 81) || ($v1 == 82) || ($v1 == 83)) var %enc = malboro
    if ((%mob == 84) || ($v1 == 85) || ($v1 == 86) || ($v1 == 87) || ($v1 == 88)) var %enc = adamantoise
    if ((%mob == 89) || ($v1 == 90) || ($v1 == 91) || ($v1 == 92)) var %enc = behemoth
    if ((%mob == 93) || ($v1 == 94) || ($v1 == 95)) var %enc = UltimaWeapon
    if ((%mob == 96) || ($v1 == 97)) var %enc = Gilgamesh
    if ((%mob == 98) || ($v1 == 99)) var %enc = Ozma
    if (%mob == 100) var %enc = Sephiroth
    msg $chan /me $nick is looking for an opponent to fight. $iif(%enc = Nothing,%enc,$iif($v1 == bat,A %enc,$iif($v1 == flan,A %enc,$iif($v1 == goblin,A %enc,$iif($v1 == bomb,A %enc,$iif($v1 == ahriman,An %enc,$iif($v1 == basilisk,A %enc,$iif($v1 == cactuar,A %enc,$iif($v1 == tomberry,A %enc,$iif($v1 == malboro,A %enc,$iif($v1 == adamantoise,An %enc,$iif($v1 == behemoth,A %enc,$iif($v1 == UltimaWeapon,Look out! %enc,$iif($v1 == Gilgamesh,The mighty %enc,$iif($v1 == Ozma,That's hard! %enc,Good luck! %enc))))))))))))))) was found.
    if (%enc == Nothing) return
    var %currlvl = $readini(ffbot\users.ini, level, $nick)
    if (%currlvl == $NULL) %currlvl = 1
    var %moblvl = $readini(ffbot\mobs.ini, level, %enc)
    var %win = 0
    if (%currlvl > $calc((%moblvl)+2)) var %win = 1
    elseif ($calc((%currlvl)+2) < %moblvl) var %win = 2
    else var %win = $rand(1,2)
    if (%win == 1) {
      var %expgained = $readini(ffbot\mobs.ini, exp, %enc)
      writeini ffbot\users.ini exp $nick $calc($readini(ffbot\users.ini, exp, $nick) + %expgained)
      var %totalexp = $readini(ffbot\users.ini, exp, $nick)
      var %i = 1
      while (%i <= $ini(ffbot\levels.ini,levels,0)) { 
        var %item $ini(ffbot\levels.ini,levels,%i) 
        var %expneed $readini(ffbot\levels.ini,levels,%item) 
        if (%totalexp >= %expneed) var %newlvl = %i
        inc %i
      }
      writeini ffbot\users.ini level $nick %newlvl
      if (%currlvl > $calc((%moblvl)+2)) {
        if (%currlvl < %newlvl) msg $chan /me Easy battle. $nick get %expgained pt exp. LEVEL UP! DatSheffy 
        else msg $chan /me Easy battle. $nick get %expgained pt exp.
      }
      elseif (%currlvl < %newlvl) msg $chan /me $nick won. You get %expgained pt exp. LEVEL UP! DatSheffy 
      else msg $chan /me $nick won. You get %expgained pt exp. 
    }
    if (%win == 2) {
      if ($calc((%currlvl)+2) < %moblvl) msg $chan /me $nick lost. Your level is too low for this.  
      else msg $chan /me $nick lost. Unlucky battle, try harder next time. 
    }
  }
  else msg $chan /me this command is on cool down
}


Code:
on *:TEXT:!mylvl:#: {
  var %currlvl = $readini(ffbot\users.ini, level, $nick)
  if (%currlvl == $NULL) %currlvl = 1
  var %currexp = $readini(ffbot\users.ini, exp, $nick)
  var %nextexp = $readini(ffbot\levels.ini, levels, $calc(%currlvl + 1))


Link Copied to Clipboard