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
}
/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