Ping Pong

By RussellReal on Jan 10, 2007

ping pong, pretty fun, You can't win tho ;) Yet.. but its still fun to play, type /pingpong to open the @window and rightclick and press "on" to play, to restart just use "on" again "off" just stops timers, and such. other than that enjoy, (First script release, besides my friends list on hawkee.com, come along way since my first appearance here) join #scripts on swiftirc.net to chill with me ;)

alias pingpong {
  window -aCp +f @pingpong -1 -1 400 600
}
menu @pingpong {
  mouse:movebar1 $mouse.x
  .commands
  ..on:startping
  ..off:stopping
  ..exit:{
    close -@
    timers off
  }
}
alias -l startping {
  drawrect -rf @pingpong $rgb(255,255,255) 2 160 290 70 70
  writeini mouse.ini x speed $iif($?="enter the desired speed 1 being the highest",$v1,50)
  moveball d l 200 300 
}
alias -l stopping {
  timers off
  remini mouse.ini x
} 
alias -l moveball {
  var %dir = $iif($1 == d,-,+), %lor = $iif($2 == l,+,-), %dir1 = $1, %lor1 = $2, %x = $calc($3 %dir 15), %y = $calc($4 %lor 15)
  movebar2 $calc(%x $iif(%dir == -,+,-) 10)
  writeini mouse.ini x x $calc(%x $iif(%dir == -,+,-) 10)
  if ((%y isnum 35-45) && ($abs($calc(%x - $readini(mouse.ini,x,x))) isnum 0-15)) {
    if ($left($calc(%x - $readini(mouse.ini,x,x)),1) == -) {
      clear @pingpong
      movebar1 $mouse.x
      var %lor = -, %lor1 = l, %dir = -, %dir1 = d
      .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)        
      beep 1
    }
    else {
      clear @pingpong
      movebar1 $mouse.x
      var %lor = -, %lor1 = l, %dir = +, %dir1 = u
      .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)     
      beep 1
    }
  }
  else {
    if ((%y isnum 555-565) && ($abs($calc(%x - $mouse.x)) isnum 0-15)) {
      if ($left($calc(%x - $mouse.x),1) == -) {
        clear @pingpong
        movebar1 $mouse.x
        var %lor = +, %lor1 = r, %dir = -, %dir1 = d
        .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)        
        beep 1
      }
      else {
        clear @pingpong
        movebar1 $mouse.x
        var %lor = +, %lor1 = r, %dir = +, %dir1 = u
        .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)     
        beep 1
      }
    }
    else {
      drawrect -fr @pingpong $rgb(255,255,255) 2 $calc($3 - 15) $calc($4 - 15) 30 30
      drawdot -r @pingpong $rgb(255,0,0) 5 %x %y
      if ((%y <= 0) || (%y >= 600)) { 
        .timers off
        if (%y >= 600) drawtext -r @pingpong $rgb(255,0,0) 160 290 YOU LOSE!
        else drawtext -r @pingpong $rgb(255,0,0) 160 290 YOU WIN!
        halt
      }
      else {
        if ((%x <= -3) || (%x >= 400)) {
          var %dir1 = $iif(%dir1 == d,u,d), %dir = $iif(%dir1 == d,-,+)
          .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)
        }
        else {
          .timerp -m 1 $readini(mouse.ini,x,speed) transition %dir1 %lor1 $calc($3 %dir 3) $calc($4 %lor 3)
        }
      }
    }
  }
}
alias -l transition {
  .timers off
  moveball $1 $2 $3 $4
}
alias -l movebar1 {
  drawline -r @pingpong $rgb(255,255,255) 2 0 560 400 560
  drawline -r @pingpong $rgb(0,0,0) 2 $calc($1 - 10) 560 $calc($1 + 10) 560
}
alias -l movebar2 {
  drawline -r @pingpong $rgb(255,255,255) 2 0 40 400 40
  drawline -r @pingpong $rgb(0,0,0) 2 $calc($1 - 10) 40 $calc($1 + 10) 40
}

Comments

Sign in to comment.
guest598594   -  Sep 27, 2007

do .timeroff so u dont flood the status window :P

but i think this is really cool

 Respond  
RussellReal   -  Jul 04, 2007

The reason it\'s all black is because you set your mIRC up to have black default background. change it to white and enjoy ;)

 Respond  
AHBARAR   -  Jun 17, 2007

same as brainbryce all black just a white line and something black moving on it as i move mouse no thing else >:|

 Respond  
BrainBryce   -  Apr 13, 2007

Its bad cause Mine it just comes up with blank screen :(

 Respond  
Sanjie   -  Apr 09, 2007

awesome, pure awesome!

 Respond  
RussellReal   -  Jan 12, 2007

/pingpong starts it..
not /startping
I shoulda made that a local alias =x ;;edit I edited it so that now you can only use the correct alias (which will be helpful, because you NEED to use the right one lol)

the script is like 90ish lines long...
and this: drawrect -rf @pingpong $rgb(255,255,255) 2 160 290 70 70
happens to be the only draw rect, sorry for messing up the order on this lol :$ this is a really cool script I think anyway ;) someone rate it lol

 Respond  
Lindrian   -  Jan 11, 2007

Noutrious, he just put the file into the awayscript.ini.. The name doesnt matter.

 Respond  
Noutrious   -  Jan 11, 2007

\"(line 236, Awayscript.ini)\" mh ^^

 Respond  
Nachos   -  Jan 11, 2007
  • /drawrect: invalid window (line 236, Awayscript.ini)

That\'s the error I get. Using v6.2

 Respond  
Aaron   -  Jan 10, 2007

its kinda scary but fun :P

 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.