mIRC Home    About    Download    Register    News    Help

Print Thread
#175882 29/04/07 10:13 PM
Joined: Feb 2007
Posts: 33
H
harl91 Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Feb 2007
Posts: 33
i dont under stand what is wrong with this...

Code:
;;Map a Game.
on *:text:*map*:*:{
  if ((%games == 3) $$ ($1 == $me)) { msg $chan Opps! Seems like there is more then 3 games mapped already. Either kill a game not in use, or wait for a game to end. }
  if ((($1 == $me) && ($4 == 1v1 || 1x1 || 2v2 || 2x2 || 3v3 || 3x3) && (%games < 3))) {
    set %class $3
    :findnewmap
    if (%class == 1v1) { set %gametype strict | set %player.limit -maxplayers 2 | set %bot.players 2 | set %bot.class.map $read(1x1.text) }
    if (%class == 1x1) { set %gametype strict | set %player.limit -maxplayers 2 | set %bot.players 2 | set %bot.class.map $read(1x1.text) }
    if (%class == 2v2) { set %gametype strict | set %player.limit -maxplayers 4 | set %bot.players 4 | set %bot.class.map $read(2x2.text) }
    if (%class == 2x2) { set %gametype strict | set %player.limit -maxplayers 4 | set %bot.players 4 | set %bot.class.map $read(2x2.text) }
    if (%class == 3v3) { set %gametype strict | set %player.limit -maxplayers 6 | set %bot.players 6 | set %bot.class.map $read(3x3.text) }
    if (%class == 3x3) { set %gametype strict | set %player.limit -maxplayers 6 | set %bot.players 6 | set %bot.class.map $read(3x3.text) }
    if (%bot.class.map == $null) { goto mapdoesntexist | msg $chan No maps have yet been classified as a %class $+ . }
    if (%bot.class.map !isin c:/winbolo/maps/) { write -d $+ " $+ %maps $+ " %class $+ .txt | goto findnewmap }
    set %settings $2
    if (%settings !== map) {
      if (m isin %prefix) { set %mines -mines yes }
      if (np isin %prefix) { set %nopass yes }
    }
    :port2
    set %port $rand( %bot.port1 , %bot.port2 )
    if (%port == %port1 || %port2) { goto port2 }
    if (%nopass == yes) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %bot.class.map $+ " %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a %class game for %bot.players players. %bot.randmap  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: No Password  }
    if (%nopass == no) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %bot.class.map $+ " -password %bot.pass %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a game for %bot.players players. %bot.randmap  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: %bot.pass  }
    inc %games 1
    if (%games == 1) { set %port1 %port | set %bot.name1 $nick | set %bot.kill1 %port }
    if (%games == 2) { set %port2 %port | set %bot.name2 $nick | set %bot.kill2 %port  }
    if (%games == 3) { set %bot.name3 $nick | set %bot.kill3 %port  }
    :mapdoesntexist
    set %mines -mines no
    set %player.limit
    set %nopass no
    set %bot.players 16
  }
  if ((($1 == $me) && ($3 == $null) && (%games < 3))) {
    set %bot.numberofmaps  $findfile(c:/winbolo/maps/,*.map,0,1)
    set %bot.mapnumber $rand(1,%bot.numberofmaps)
    set %bot.randmap1 $findfile(c:/winbolo/maps/,*.map,%bot.mapnumber,1)
    set %bot.randmap $right( %bot.randmap1 , -16 )
    set %settings $2
    if (%settings == map) { set %gametype strict }
    if (%settings !== map) {
      set %prefix $right( %settings , -3 )
      if (s || o || t !isin %prefix) { set %gametype strict }
      if (s isin %prefix) { set %gametype strict }
      if (o isin %prefix) { set %gametype open }
      if (t isin %prefix) { set %gametype tournament }
      if (m isin %prefix) { set %mines -mines yes }
      if (np isin %prefix) { set %nopass yes }
      if (2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 !isin %prefix) { set %player.limit }
      if (2 isin %prefix) { set %player.limit -maxplayers 2 | set %bot.players 2 }
      if (3 isin %prefix) { set %player.limit -maxplayers 3 | set %bot.players 3 }
      if (4 isin %prefix) { set %player.limit -maxplayers 4 | set %bot.players 4 }
      if (5 isin %prefix) { set %player.limit -maxplayers 5 | set %bot.players 5 }
      if (6 isin %prefix) { set %player.limit -maxplayers 6 | set %bot.players 6 }
      if (7 isin %prefix) { set %player.limit -maxplayers 7 | set %bot.players 7 }
      if (8 isin %prefix) { set %player.limit -maxplayers 8 | set %bot.players 8 }
      if (9 isin %prefix) { set %player.limit -maxplayers 9 | set %bot.players 9 }
      if (10 isin %prefix) { set %player.limit -maxplayers 10 | set %bot.players 10 }
    }
    :port1
    set %port $rand( %bot.port1 , %bot.port2 )
    if (%port == %port1 || %port2) { goto port1 }
    msg $chan You have not chosen the map you wish to play on. I will choose one for you.
    if (%nopass == yes) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %bot.randmap $+ " %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a game for %bot.players players. %bot.randmap  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: No Password  }
    if (%nopass == no) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %bot.randmap $+ " -password %bot.pass %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a game for %bot.players players. %bot.randmap  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: %bot.pass  }
    inc %games 1
    if (%games == 1) { set %port1 %port | set %bot.name1 $nick | set %bot.kill1 %port }
    if (%games == 2) { set %port2 %port | set %bot.name2 $nick | set %bot.kill2 %port  }
    if (%games == 3) { set %bot.name3 $nick | set %bot.kill3 %port  }
    set %mines -mines no
    set %player.limit
    set %nopass no
    set %bot.players 16
  }
  if ((($1 == $me) && (%games < 3) && ($3 !== $null))) {
    set %map $3-
    set %.map $right( %map , 4)
    if (%.map !== .map) { set %map %map $+ .map }
    if ($exists(c:\winbolo\maps\ $+ %map $+ ) == $true) { 
      set %settings $2
      if (%settings == map) { set %gametype strict }
      if (%settings !== map) {
        set %prefix $right( %settings , -3 )
        if (s || o || t !isin %prefix) { set %gametype strict }
        if (s isin %prefix) { set %gametype strict }
        if (o isin %prefix) { set %gametype open }
        if (t isin %prefix) { set %gametype tournament }
        if (m isin %prefix) { set %mines -mines yes }
        if (np isin %prefix) { set %nopass yes }
        if (2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 !isin %prefix) { set %player.limit }
        if (2 isin %prefix) { set %player.limit -maxplayers 2 | set %bot.players 2 }
        if (3 isin %prefix) { set %player.limit -maxplayers 3 | set %bot.players 3 }
        if (4 isin %prefix) { set %player.limit -maxplayers 4 | set %bot.players 4 }
        if (5 isin %prefix) { set %player.limit -maxplayers 5 | set %bot.players 5 }
        if (6 isin %prefix) { set %player.limit -maxplayers 6 | set %bot.players 6 }
        if (7 isin %prefix) { set %player.limit -maxplayers 7 | set %bot.players 7 }
        if (8 isin %prefix) { set %player.limit -maxplayers 8 | set %bot.players 8 }
        if (9 isin %prefix) { set %player.limit -maxplayers 9 | set %bot.players 9 }
        if (10 isin %prefix) { set %player.limit -maxplayers 10 | set %bot.players 10 }
      }
      :port
      set %port $rand( %bot.port1 , %bot.port2 )
      if (%port == %port1 || %port2) { goto port }
      if (%nopass == yes) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %map $+ " %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a game for %bot.players players. %map  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: No Password  }
      if (%nopass == no) { /run c:/winbolo/wonkadsrun.exe %gametype %port " $+ %map $+ " -password %bot.pass %mines %player.limit %logging -autoclose -quitonwin | msg $chan  $nick has just started a game for %bot.players players. %map  @ winbolo:// $+ %bot.ip $+ : $+ %port - %gametype - password: %bot.pass  }
      inc %games 1
      if (%games == 1) { set %port1 %port | set %bot.name1 $nick | set %bot.kill1 %port }
      if (%games == 2) { set %port2 %port | set %bot.name2 $nick | set %bot.kill2 %port  }
      if (%games == 3) { set %bot.name3 $nick | set %bot.kill3 %port  }
      set %mines -mines no
      set %player.limit
      set %nopass no
      set %bot.players 16
    }
    if ($exists(c:/winbolo/maps/ $+ %map $+ ) == $false) { msg $chan Opps! You must have spelled the map name wrong, or i dont have that map }
  }
}


when i type harlbot map 2v2, it goes to the if command if ((($1 == $me) && (%games < 3) && ($3 !== $null))) and then spits out "Opps! You must have spelled the map name wrong, or i dont have that map"

its going to the wrong if command and i have no idea why

Last edited by harl91; 29/04/07 10:14 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) The $$ isn't a comparator in your 1st if statement
2) The usage of || (aka OR) in your second if statement requires additional parameters. Proper format would be:
Code:
($4 == 1v1 || $4 == 1x1 || $4 == 2v2 || $4 == 2x2 || $4 == 3v3 || $4 == 3x3) 

3) Not incorrect, just bad form, in the newmap section, you use multiple if's, when using if/elseif when doing the %class comparison would be better.

Similar problems throughout the remainder of your code.


Link Copied to Clipboard