- on *:text:!21:#: {
- if (%21jog !== on) {
- set %21jog on
- set %21jogador-1 $nick
- /msg $chan This Game Need 2 Players. Someone need type !21 to play against you in 60 seconds.
- .timer_encerra-21 1 62 /encerra-21 $chan
- set %21para-jog-1 off
- halt
- }
- if (%21jog == on) && (!%21jogador-2) {
- /timer_21-um-so off
- set %21jogador-2 $nick
- /notice %21jogador-1 Thi's the 21 Cards game! wher who aproximate the cards to the number: 21 Wins the game!
- /notice %21jogador-2 Thi's the 21 Cards game! wher who aproximate the cards to the number: 21 Wins the game!
- /msg $chan Formed Game!! 9-14=[12 %21jogador-1 14]=9- 7& 9-14=[2 %21jogador-2 14]=9-
- /msg $chan for order 9-14=[12 %21jogador-1 14]=9- play first! type 4!card you have 60 seconds to play
- set %21jogada-jog 1
- set %21para-jog-2 off
- .timer_encerra-21 1 62 /encerra-21 $chan
- }
- }
- on *:text:!card:#: {
- if (%21jogada-jog == 1) && ($nick == %21jogador-1) {
- set %carta-jog-1 $rand(1,13)
- if (!%cartas-valor-jog-1) {
- set %cartas-valor-jog-1 %carta-jog-1
- set %cartas-jog-1 $passa-carta(%carta-jog-1)
- set %21jogada-jog 2
- /notice $nick your cards: %cartas-jog-1
- /notice $nick your total: %cartas-valor-jog-1
- /calcula-proxima-oupara %cartas-valor-jog-1 %21jogador-1 $chan
- }
- else {
- set %21jogada-jog 2
- set %cartas-valor-jog-1 $calc(%cartas-valor-jog-1 + %carta-jog-1)
- set %cartas-jog-1 %cartas-jog-1 $passa-carta(%carta-jog-1)
- /notice $nick your cards: %cartas-jog-1
- /notice $nick your total: %cartas-valor-jog-1
- /calcula-proxima-oupara %cartas-valor-jog-1 %21jogador-1 $chan
- }
- }
- if (%21jogada-jog == 2) && ($nick == %21jogador-2) {
- set %carta-jog-2 $rand(1,13)
- if (!%cartas-valor-jog-2) {
- set %cartas-valor-jog-2 %carta-jog-2
- set %cartas-jog-2 $passa-carta(%carta-jog-2)
- set %21jogada-jog 1
- /notice $nick your cards: %cartas-jog-2
- /notice $nick your total: %cartas-valor-jog-2
- /calcula-proxima-oupara %cartas-valor-jog-2 %21jogador-2 $chan
- }
- else {
- set %21jogada-jog 1
- set %cartas-valor-jog-2 $calc(%cartas-valor-jog-2 + %carta-jog-2)
- set %cartas-jog-2 %cartas-jog-2 $passa-carta(%carta-jog-2)
- /notice $nick your cards: %cartas-jog-2
- /notice $nick your total: %cartas-valor-jog-2
- /calcula-proxima-oupara %cartas-valor-jog-2 %21jogador-2 $chan
- }
- }
- }
- alias encerra-21 {
- if (%21jog == on) {
- /quem-ganha-21 $1
- }
- else {
- /acaba-21
- }
- }
- alias calcula-proxima-oupara {
- if ($1 > 21) && ($2 == %21jogador-1) { /msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[12 $2 14]=9- Explodes with the cards %cartas-jog-1 Totalizing:4 %cartas-valor-jog-1 | /timer_encerra-21 off | /msg $3 Winner 9-14=[2 %21jogador-2 14]=9- with the Cards %cartas-jog-2 Totalizing:4 %cartas-valor-jog-2 | /acaba-21 | halt }
- if ($1 == 21) && ($2 == %21jogador-1) { /msg $3 Winner 9-14=[12 %21jogador-1 14]=9- with the cards %cartas-jog-1 Totalizing:4 %cartas-valor-jog-1 | /timer_encerra-21 off | /acaba-21 | halt }
- if ($1 < 21) && ($2 == %21jogador-1) {
- if (%21para-jog-2 !== on) { /msg $3 9-14=[2 %21jogador-2 14]=9- Your Time! Type 4 !card to one more card or type 4 !compare To comparate the cards and end the game! you have 60 seconds }
- if (%21para-jog-2 == on) { set %21jogada-jog 1 | /msg $3 9-14=[12 %21jogador-1 14]=9- You rule! Type 4 !card to one more card or type 4 !comparate To comparate the cards and end the game! you have 60 seconds | .timer_encerra-21 1 62 /encerra-21 $3 | halt }
- }
- if ($1 > 21) && ($2 == %21jogador-2) { /msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[2 $2 14]=9- Explodes with the cards %cartas-jog-2 Totalizing:4 %cartas-valor-jog-2 | /msg $3 Winner 9-14=[12 %21jogador-1 14]=9- with the cards %cartas-jog-1 Totalizing:4 %cartas-valor-jog-1 | /timer_encerra-21 off | /acaba-21 | halt }
- if ($1 == 21) && ($2 == %21jogador-2) { /msg $3 Winner 9-14=[2 %21jogador-2 14]=9- with the cards %cartas-jog-2 Totalizing:4 %cartas-valor-jog-2 | /timer_encerra-21 off | /acaba-21 | halt }
- if ($1 < 21) && ($2 == %21jogador-2) {
- if (%21para-jog-1 !== on) { /msg $3 9-14=[12 %21jogador-1 14]=9- Your Time! Type 4 !card to one more card or type 4 !compare To comparate the cards and end the game! you have 60 seconds | halt }
- if (%21para-jog-1 == on) { set %21jogada-jog 2 | /msg $3 9-14=[2 %21jogador-2 14]=9- You rule! Type 4 !card to one more card or type 4 !comparate To comparate the cards and end the game! you have 60 seconds | .timer_encerra-21 1 62 /encerra-21 $3 | halt }
- }
- }
- alias acaba-21 {
- set %21jog off
- unset %21jogador-1 %21jogador-2 %cartas-valor-jog-1 %cartas-jog-1 %cartas-valor-jog-2 %cartas-jog-2
- }
- on *:text:!comparate:#: {
- if (%21jogada-jog == 1) {
- if ($nick == %21jogador-1) && (%21para-jog-2 !== on) { /set %21para-jog-1 on | set %21jogada-jog 2 | /msg $chan 9-14=[2 %21jogador-2 14]=9- Your rule! Type 4 !card to one more card or type 4 !comparate To comparate the cards and end the game! you have 60 seconds | .timer_encerra-21 1 62 /encerra-21 $chan }
- if ($nick == %21jogador-1) && (%21para-jog-2 == on) { /quem-ganha-21 $chan | /timer_encerra-21 off }
- }
- if (%21jogada-jog == 2) {
- if ($nick == %21jogador-2) && (%21para-jog-1 !== on) { /set %21para-jog-2 on | set %21jogada-jog 1 | /msg $chan 9-14=[12 %21jogador-1 14]=9- Your rule! Type 4 !card to one more card or type 4 !comparate To comparate the cards and end the game! you have 60 seconds | .timer_encerra-21 1 62 /encerra-21 $chan }
- if ($nick == %21jogador-2) && (%21para-jog-1 == on) { /quem-ganha-21 $chan | /timer_encerra-21 off }
- }
- }
- alias quem-ganha-21 {
- set %21total-jog-1 $calc(21 - %cartas-valor-jog-1)
- set %21total-jog-2 $calc(21 - %cartas-valor-jog-2)
- if (%21total-jog-1 < %21total-jog-2) { /timer_encerra-21 off | /msg $1 Winner 9-14=[12 %21jogador-1 14]=9- with the cards %cartas-jog-1 Totalizing:4 %cartas-valor-jog-1 | /msg $1 against the Cards: %cartas-jog-2 Of 9-14=[2 %21jogador-2 14]=9- Totalizing:4 %cartas-valor-jog-2 | /acaba-21 | halt }
- if (%21total-jog-1 > %21total-jog-2) { .timer_encerra-21 off | /msg $1 Winner 9-14=[2 %21jogador-2 14]=9- with the Cards %cartas-jog-2 Totalizing:4 %cartas-valor-jog-2 | /msg $1 against the Cards: %cartas-jog-1 Of 9-14=[2 %21jogador-1 14]=9- Totalizing:4 %cartas-valor-jog-1 | /acaba-21 | halt }
- if (%21total-jog-1 == %21total-jog-2) { .timer_encerra-21 off | /msg $1 This Game have no winner! | /acaba-21 | halt }
- }
- alias passa-carta {
- set %21cor $rand(1,2)
- if (%21cor == 1) { set %21cort 1 }
- if (%21cor == 2) { set %21cort 4 }
- if ($1 == 1) { return $+ %21cort $+ ,0 $+ [A] }
- if ($1 == 2) { return $+ %21cort $+ ,0 $+ [2] }
- if ($1 == 3) { return $+ %21cort $+ ,0 $+ [3] }
- if ($1 == 4) { return $+ %21cort $+ ,0 $+ [4] }
- if ($1 == 5) { return $+ %21cort $+ ,0 $+ [5] }
- if ($1 == 6) { return $+ %21cort $+ ,0 $+ [6] }
- if ($1 == 7) { return $+ %21cort $+ ,0 $+ [7] }
- if ($1 == 8) { return $+ %21cort $+ ,0 $+ [8] }
- if ($1 == 9) { return $+ %21cort $+ ,0 $+ [9] }
- if ($1 == 10) { return $+ %21cort $+ ,0 $+ [10] }
- if ($1 == 11) { return $+ %21cort $+ ,0 $+ [J] }
- if ($1 == 12) { return $+ %21cort $+ ,0 $+ [Q] }
- if ($1 == 13) { return $+ %21cort $+ ,0 $+ [K] }
- }
- alias weather {
- sockclose weather- $+ $replace($1-,$chr(32),+)
- sockopen weather- $+ $replace($1-,$chr(32),+) www.weather.com 80
- }
- on *:SOCKOPEN:weather*:{
- sockwrite -n $sockname GET /weather/local/ $+ $gettok($sockname,2-,45) $+ ?lswe= $+ $gettok($sockname,2-,45) $+ &lwsa=WeatherLocalUndeclared&from=whatwhere HTTP/1.1
- sockwrite -n $sockname Host: www.weather.com
- sockwrite -n $sockname Connection: close
- sockwrite -n $sockname User-Agent: Mozilla/3.0 (compatible)
- sockwrite -n $sockname Authorization: Basic
- sockwrite -n $sockname $crlf
- }
- on *:sockread:weather*: {
- sockread %temp
- if (">Updated isin %temp) {
- set %we.update $nohtml(%temp) | haltdef
- }
- if (</B></TD> isin %temp) {
- if ( isin $nohtml(%temp)) {
- set %we.cond $remove($nohtml(%temp),$chr(9)) | haltdef
- }
- }
- if (ALIGN="left"><H2 CLASS="moduleTitleBar"><B>Right Now for</B><BR> isin %temp) {
- set %we.loc $remove($remove($gettok($nohtml(%temp),3-,32),for),Save this Location) | haltdef
- }
- if (Feels Like isin %temp) {
- set %we.temp $remove($nohtml(%temp),$chr(9)) | set %we.temperature $remove($replace($gettok(%we.temp,1,32),°, $+ $chr(176)),Feels) | set %we.feelslike $chr(40) $+ feels like $replace($gettok(%we.temp,3,32),°, $+ $chr(176)) $+ $chr(41) | haltdef
- }
- if (*CLASS="obsTextA">*%</td>* iswm %temp) {
- set %we.hum %temp | set %we.humidity $gettok($gettok(%we.hum,2,62),1,60) | haltdef
- }
- if (*CLASS="obsTextA">*mph</td>* iswm %temp) {
- set %we.wind %temp | set %we.windex $gettok($gettok(%we.wind,2,62),1,60) | haltdef
- }
- if (*CLASS="obsTextA">*°*</td>* iswm %temp) {
- set %we.dew %temp | set %we.dewpoint $replace($gettok($gettok(%we.dew,2,62),1,60),°, $+ $chr(176)) | haltdef
- }
- if (sunrise: isin %temp) {
- set %we.sunrise $remove($nohtml(%temp),$chr(9),sunrise:)
- }
- if (sunset: isin %temp) {
- set %we.sunset $remove($nohtml(%temp),$chr(9),sunset:)
- }
- if (*CLASS="obsTextA">*miles</td>* iswm %temp) {
- set %we.vis %temp | set %we.visibility $gettok($gettok(%we.vis,2,62),1,60) | haltdef
- }
- }
- on *:SOCKCLOSE:weather*:{
- msg %we.chan [^B] $+ %we.loc $+ [^B]: %we.temperature %we.feelslike - [^B]Conditions[^B]: %we.cond - [^B]Humidity[^B]: %we.humidity - [^B]Visibility[^B]: %we.visibility - [^B]Wind[^B]: %we.windex - [^B]Dew Point[^B]: %we.dewpoint - [^B]Sunrise[^B]: %we.sunrise - [^B]Sunset[^B]: %we.sunset - $chr(40) $+ %we.update $+ $chr(41) - [^B]www.weather.com[^B] | unset %we. | unset %temp
- }
- alias -l nohtml {
- var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
- return %x
- }
- on *:TEXT:.weather *:#:{
- if ($2 isnum) && ($len($2) == 5) {
- /weather $2 | set %we.chan $chan }
- else {
- msg $chan Incorrect zip code format.
- }
- }
- on *:input:*: {
- if ($1 = .google) && ($2) {
- if ($chan = $null) {
- run http://www.google.com/search?q= $+ $htmlfrm($2-)
- halt
- }
- run http://www.google.com/search?q= $+ $htmlfrm($2-)
- halt
- }
- }
- on *:text:*.google*:*: {
- if ($chan = $null) {
- notice $nick http://www.google.com/search?q= $+ $htmlfrm($2-)
- halt
- }
- notice $nick http://www.google.com/search?q= $+ $htmlfrm($2-)
- }
- alias htmlfrm {
- var %i = 1,%r
- while (%i <= $len($1-)) {
- if ($mid($1-,%i,1) isalnum) { %r = %r $+ $ifmatch }
- else { %r = %r $+ % $+ $base($asc($mid($1-,%i,1)),10,16,2) }
- inc %i
- }
- return %r
- }
- on *:JOIN:#temptation:{ notice $nick %greet | notice $nick %greet2 | notice $nick %greet3 }
- on *:TEXT:*:#:{
- if ($1 == %trig $+ cmd) && ($ulevel >= 4) {
- if ($2 == join) { join $3 | notice $nick Joined $3 }
- elseif ($2 == part) { part $3 | notice $nick Parted $3 }
- else { msg $chan Sorry, you lack access to that command, or the command does not exist. }
- }
- elseif ($1 == %trig $+ set) && ($ulevel >= 4) {
- if ($2 == trig) { set %trig $3 | notice $nick Trigger set to $3 }
- elseif ($2 == greet) { set %greet $3- | notice $nick Greeting set to $3- }
- elseif ($2 == greet2) { set %greet2 $3- | notice $nick Greeting2 set to $3- }
- elseif ($2 == greet3) { set %greet3 $3- | notice $nick Greeting3 set to $3- }
- elseif ($2 == voice) { mode #temptation +v $3 | cs #temptation addpeon $3 }
- elseif ($2 == op) { mode #temptation +o $3 | cs #temptation addop $3 }
- }
- }
Posted by alex on Wed 20 Aug 20:31 (modification of post by view diff)
report abuse | download | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.