OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
The following two snippets, which are part of a larger script, seem to be conflicting with each other. When the command, that should activate the first snippet is used, the second one gets started. on *:text:!*list &:*:{
set %file $iif((Truth isin $1) || (Dare isin $1),$+($v1,.txt))
if (!$2) {
if ($play(1)) { msg $nick The $right($1,-1) is on it's way. Please be patient as someone else may be viewing it }
else { .play $nick %file 2000 | .unset %file }
}
elseif $2 > $lines(%file) { .notice $nick Sorry, but $v1 number $2 doesn't exist }
else describe %td.chan $read(%file,$2)
}
on *:TEXT:!dare*:#:{
set %spinnick_choice d
if ($nick == %spin.last) {
set %darenick %spin.nick
set %dare $iif(($1 == !dare),$2-, $remove($$1-,!dare))
if $istok(%dare,%darenick,32) { set %dare $remtok(%dare,%darenick,1,32) }
if $numtok(%dare,32) = 1 { set %dare $instok(%dare,15,1,32) }
tokenize 32 %dare
if ($1 isnum) { set %daretime $calc(60 * $1) }
elseif ($numtok($1,58)) { set %daretime $iif($numtok($1,58) = 1,$calc(60 * $duration($1)),$duration($1)) }
describe # 5 Watches as 1 $nick sets the egg timer to 4 $duration(%daretime) for 12 %darenick $+ 's dare, " $2- "
timer 1 %daretime describe # 5 hears the egg timer ding, time up for %darenick $+ 's dare, " $2- "
}
else if ($nick != %spin.nick) { describe # 5 looks to $nick and laughs... "Sorry, you were not the one that spun the bottle" }
}
Those are the two sections that I've identified problems with, but the entire script follows, in case someone can spot & help resolve a problem before it shows up. #td2 on
on *:text:truth*:#:{ if $nick == %spin.nick { set %spin.nick_choice T } }
on *:text:dare*:#:{ if $nick == %spin.nick { set %spin.nick_choice D } }
on *:text:*choice*:#:{ if $nick == %spin.nick { set %spin.nick_choice SC } }
on *:text:sc:#:{ set %spin.nick_choice SC }
on *:text:*who*turn*:#:{
if !%spin.nick_choice {
if $numtok(%play.list,44) > 1 { describe # 5 says %spin.nick needs to pick Truth, Dare, %spin.last $+ 's choice, or !choose }
elseif $numtok(%play.list,44) == 1 { describe # 5 says %play.list is the only player }
else describe # 5 says there are no players
}
elseif %spin.nick_choice == T {
describe # 5 reminds %spin.last that %spin.nick is waiting for a Truth query
describe # 5 or %spin.nick needs to answer %spin.last $+ 's Truth query
}
elseif %spin.nick_choice == D {
.notice %spin.last If you need to check %spin.nick $+ 's limits, type !showme %spin.nick
describe # 5 reminds %spin.last that %spin.nick is waiting for a Dare
describe # 5 or %spin.nick needs to complete %spin.last $+ 's dare
}
else describe # 5 It is %spin.nick $+ 's turn to spin
}
on *:TEXT:!autoplay:#:{
if !$read($mknickfn($nick),s,Limits:) {
describe # is sorry to say that the autoplay feature requires $nick to have their limits set
set %play_temp $addtok(%play_temp,$nick,44)
.msg $nick To set your limits, type !limit your limits here
.msg $nick Put your limits in place of your limits here
.msg $nick For example: !limit scat, animals, kids, golden showers
}
elseif $read($mknickfn($nick),s,autoplay) != on {
.write -sautoplay $mknickfn($nick) autoplay on
describe # is happy to announce that $nick has decided to be a permanent player
set %play.list $addtok(%play.list,$nick,44)
describe # 5 :Current Players Are %play.list
}
else {
write -sautoplay $mknickfn($nick) autoplay off
describe # sighs as $nick has decided to no longer be a permanent player
}
}
on 10:text:!cheat &:?:{
if (!$2) && (!%cheaters) { .notice $nick No one is cheating }
elseif $2 == %spin.nick { .notice $nick $2 cannot spin themselves }
elseif (!$istok(%play.list,$2,44)) { .notice $nick $2 is not playing }
else {
set %cheaters $addtok(%cheaters,$2,44)
.notice $nick $2 is scheduled to be spun
}
}
on 10:TEXT:!add *:#:{
var %play.add = $2-
var %a = 1
while %a <= $numtok(%play.add,32) {
if $istok(%watch,$gettok(%play.add,%a,32),44) {
.timer 1 300 $remtok(%watch,$gettok(%play.add,%a,32),1,44)
.notice $nick $gettok(%play.add,%a,32) is on a 5min play delay
}
else set %play.list $addtok(%play.list,$gettok(%play.add,%a,32),44)
inc %a
}
describe # 5 Current Players Are %play.list
}
on 10:TEXT:!remove *:#:{
if ( $numtok($2-,32) => 1 ) {
var %x = 1
while ( %x <= $numtok($2-,32) ) {
set %play.list $remtok(%play.list,$gettok($2-,%x,32),1,44)
set %cheaters $remtok(%cheaters,$gettok($2-,%x,32),1,44)
inc %x
}
}
describe # 5 watches as $nick removes $2- from the playlist
if (!%play.list) describe # 5There are no players
else describe # 5 :Current Players Are %play.list
if $istok($2-,%spin.last,32) { unset %spin.last }
if $istok($2-,%spin.nick,32) { unset %spin.nick }
}
on *:TEXT:!watch:#:{
; if (%play.time. $+ $nick) { .write -splaytime $mknickfn($nick) playtime %play.time. $+ $nick }
if $istok(%cheaters,$nick,44) { set %cheaters $remtok(%cheaters,$nick,1,44) }
if $istok(%play.list,$nick,44) {
set %play.list $remtok(%play.list,$nick,1,44)
set %watch $addtok(%watch,$nick,44)
describe # 5 sighs as $nick decides to stop playing
if (!%play.list) describe # 5There are no players
else describe # 5 :Current Players Are %play.list
if ($nick == %spin.last) unset %spin.last
if ($nick == %spin.nick) unset %spin.nick
}
else describe # 5 whispers to $nick $+ , "you are not playing"
}
on *:PART:#:{
; if (%play.time. $+ $nick) { .write -splaytime $mknickfn($nick) playtime %play.time. $+ $nick }
if $istok(%cheaters,$nick,44) { set %cheaters $remtok(%cheaters,$nick,1,44) }
if $istok(%watch,$nick,44) { set %watch $remtok(%watch,$nick,1,44) }
if $istok(%play.list,$nick,44) {
set %play.list $remtok(%play.list,$nick,1,44)
if (!%play.list) describe # 5There are no players
else describe # 5 :Current Players Are %play.list
if ($nick == %spin.last) unset %spin.last
if ($nick == %spin.nick) unset %spin.nick
}
}
on *:QUIT:{
; if (%play.time. $+ $nick) { .write -splaytime $mknickfn($nick) playtime %play.time. $+ $nick }
if $istok(%cheaters,$nick,44) { set %cheaters $remtok(%cheaters,$nick,1,44) }
if $istok(%watch,$nick,44) { set %watch $remtok(%watch,$nick,1,44) }
if $istok(%play.list,$nick,44) { set %play.list $remtok(%play.list,$nick,1,44) }
if ($nick == %spin.last) unset %spin.last
if ($nick == %spin.nick) unset %spin.nick
}
on *:KICK:#:{
; if (%play.time. $+ $knick) { .write -splaytime $mknickfn($knick) playtime %play.time. $+ $knick }
if $istok(%cheaters,$knick,44) { set %cheaters $remtok(%cheaters,$knick,1,44) }
if $istok(%watch,$knick,44) { set %watch $remtok(%watch,$knick,1,44) }
if $istok(%play.list,$knick,44) {
set %play.list $remtok(%play.list,$knick,1,44)
if (!%play.list) describe # 5There are no players
else describe # 5 :Current Players Are %play.list
if ($knick == %spin.last) unset %spin.last
if ($knick == %spin.nick) unset %spin.nick
}
}
on *:NICK:{
/*
if (%play.time. $+ $nick) {
set -u $+ $duration(%play.time. $+ $nick) %play.time. $+ $newnick
}
*/
if $istok(%play.list,$nick,44) { set %play.list $reptok(%play.list,$nick,$newnick,1,44) }
if $istok(%watch,$nick,44) { set %watch $reptok(%watch,$nick,$newnick,44) }
var %away.1 = afk,brb,bbl,ing,bbiab,away
while (%away.1) && ($istok(%play.list,$newnick,44)) {
var %away.2 $gettok(%away.1,1,44)
if ($left($newnick,$len(%away.2)) == %away.2) || ($right($newnick,$len(%away.2)) == %away.2) {
set %play.list $remtok(%play.list,$newnick,1,44)
if $istok(%cheaters,$nick,44) { set %cheaters $remtok(%cheaters,$nick,1,44) }
if ($nick == %spin.last) || ($nick == %spin.nick) { unset $v2 }
}
set %away.1 $remtok(%away.1,%away.2,1,44)
}
if $read($mknickfn($newnick),s,autoplay) == on {
set %play.list $addtok(%play.list,$newnick,44)
describe %td.chan smiles as $newnick plays under the autoplay option
describe %td.chan 5Current Players are: %play.list
}
else {
if $istok(%play.list,$newnick,44) {
if ($nick == %spin.last) { set %spin.last $newnick }
if ($nick == %spin.nick) { set %spin.nick $newnick }
if $istok(%cheaters,$nick,44) { set %cheaters $reptok(%cheaters,$nick,$newnick,1,44) }
}
}
}
on *:text:!play:#:{
if $istok(%play.list,$nick,44) { describe # 5 whispers to $nick $+ , "you are already playing" }
elseif !$read($mknickfn($nick),w,Limit*) {
set %play_temp $addtok(%play_temp,$nick,44)
describe # is sorry to say that $nick can't play until they set their limits
.msg $nick To set your limits, type !limits your limits here
.msg $nick Put your limits in place of your limits here
.msg $nick For example: !limit scat, animals, kids, golden showers
}
else {
; set -u $+ $read($mknickfn($nick),s,playtime) %play.time. $+ $nick
set %play.list $addtok(%play.list,$nick,44)
if $istok(%watch,$nick,44) { set $remtok(%watch,$nick,1,44) }
describe # 5 smiles as $nick decides to play
describe # 5 Current Players Are %play.list
}
}
on *:text:!play*list:*:{
if (%play.list) {
.msg $nick 5 Current Players: %play.list
if (%spin.last) .msg $nick 5 The last person to spin was: %spin.last
if (%spin.nick) .msg $nick 5 The last person to be chosen was: %spin.nick
}
else .msg $nick 5 There is no game currently going
}
on *:text:!players:*:{
if (%play.list) {
.msg $nick 5 Current Players: %play.list
if (%spin.last) .msg $nick 5 The last person to spin was: %spin.last
if (%spin.nick) .msg $nick 5 The last person to be chosen was: %spin.nick
}
else .msg $nick 5 There is no game currently going
}
/*
on *:text:!playtime &:#:{
if (!$2) && (!%play.time. $+ $nick) {
.msg $nick Format for the !playtime command is !playtime <time>
.msg $nick <time> is to be set in HH:MM:SS format
}
elseif (!$2) .msg $nick Time remaining is $duration(%play.time. $+ $nick)
else { set -u $+ $duration($2) %play.time. $+ %spinnick }
}
*/
on 10:TEXT:!spinfor*:*:{
if (%spin.nick_choice == t) {
.write -sTruth: $mknickfn($2) Truth: $calc(1 + $read($mknickfn($2),s,Truth:))
.write -l1 Choices.txt $calc(1 + $read(Choices.txt,1))
}
elseif (%spinick_choice == d) {
.write -sDare: $mknickfn($2) Dare: $calc(1 + $read($mknickfn($2),s,Dare:))
.write -l2 Choices.txt $calc(1 + $read(Choices.txt,2))
}
else {
.write -s"Spinner's Choice:" $mknickfn($2) Spinner's Choice: $calc(1 + $read($mknickfn($2),s,Spinner's Choice:))
.write -l3 Choices.txt $calc(1 + $read(Choices.txt,3))
}
unset %spin.nick_choice
set %cheat $gettok(%cheaters,1,44)
set %cheaters $remtok(%cheaters,%cheat,1,44)
if !%cheat {
if $numtok(%play.list,44) == 1 { describe # It appears that %play.list is the only player }
elseif ($numtok(%play.list,44) == 2) {
set %spin.nick $gettok(%play.list,$rand(1,$numtok(%play.list,44)),44)
set %spin.last $$2
describe # 5 looks at %spin.nick $+ , and says " $+ $$2 wishes to know 'Truth, Dare, $$2 $+ 's Choice, # $+ 's choice with !choose?"
.timer 1 3 .notice %spin.nick 4You were picked! Truth, Dare, $$2 $+ 's Choice, !choose?
}
else {
set %spin.nick $gettok(%play.list,$rand(1,$numtok(%play.list,44)),44)
set %spin.last $$2
.write $+(lastspin_,$ctime($date)) %spin.last
.timer 1 1 describe # 5 grins as $nick spins the bottle for $$2
.timer 1 3 describe # 5 gasps happily as it halts, pointing to %spin.nick
.timer 1 5 describe # 4 %spin.nick $+ 5, Truth, Dare, $$2 $+ 's Choice, or !choose?
.timer 1 6 .notice %spin.nick 4You were picked! Truth, Dare, $$2 $+ 's Choice, or !choose?
}
}
else {
set %spin.nick %cheat
unset %cheat
set %spin.last $$2
if $numtok(%play.list,44) == 2 {
describe # 5 looks at %spin.nick $+ , and says " $+ $$2 wishes to know 'Truth, Dare, $$2 $+ 's Choice, # $+ 's choice with !choose?"
.timer 1 3 .notice %spin.nick 4You were picked! Truth, Dare, $$2 $+ 's Choice, !choose?
}
elseif $numtok(%play.list,44) > 2 {
.timer 1 1 describe # 5 grins as $nick spins the bottle for $$2
.timer 1 3 describe # 5 gasps happily as it halts, pointing to %spin.nick
.timer 1 5 describe # 5 %spin.nick $+ , Truth, Dare, $$2 $+ 's Choice, or !choose?
.timer 1 6 .notice %spin.nick 4You were picked! Truth, Dare, $$2 $+ 's Choice, or !choose?
}
else {
.timer 1 1 describe # 5 grins as $nick spins the bottle for $$2
.timer 1 3 describe # 5 gasps happily as it halts, pointing to %spin.nick
.timer 1 5 describe # 4 %spin.nick $+ 5, Truth, Dare, $$2 $+ 's Choice, or !choose?
.timer 1 6 .notice %spin.nick 4You were picked! Truth, Dare, $$2 $+ 's Choice, or !choose?
}
}
}
on *:TEXT:!spin:#:{
if (!$istok(%play.list,$nick,44)) {
describe # Sorry $nick $+ , but I don't see your name in the players list
.msg $nick type !play if you wish to play
halt
}
if ($nick != %spin.nick) && $istok(%play.list,%spin.nick,44) {
describe # 5 whispers to $nick $+ , Sorry..but it's not your turn to spin
halt
}
if (t isin %spin.nick_choice) {
.write -sTruth: $mknickfn($nick) Truth: $calc(1 + $read($mknickfn($nick),s,Truth:))
.write -l1 Choices.txt $calc(1 + $read(Choices.txt,1))
}
elseif (d isin %spin.nick_choice) {
.write -sDare: $mknickfn($nick) Dare: $calc(1 + $read($mknickfn($nick),s,Dare:))
.write -l2 Choices.txt $calc(1 + $read(Choices.txt,2))
}
else {
.write -s"Spinner's Choice:" $mknickfn($nick) Spinner's Choice: $calc(1 + $read($mknickfn($nick),s,Spinner's Choice:))
.write -l3 Choices.txt $calc(1 + $read(Choices.txt,3))
}
unset %spin.nick_choice
set %cheat $gettok(%cheaters,1,44)
set %cheaters $remtok(%cheaters,%cheat,1,44)
if $numtok(%play.list,44) == 1 { .describe # 5apologizes to $nick $+ . It appears you are the only player. }
else {
if (!%cheat) {
if $numtok(%play.list,44) == 2 {
set %spin.last $nick
set %spin.nick $remtok(%play.list,$nick,1,44)
describe # 5 looks at %spin.nick $+ , and says " $+ $nick wishes to know 'Truth, Dare, $nick $+ 's Choice, or $me $+ 's choice with !choose?"
.timer 1 3 .notice %spin.nick 4You were picked! Truth, Dare, $nick $+ 's Choice, or !choose?
halt
}
else {
if (!%spin.nick) { set %spin.nick $nick }
while %spin.nick == $nick { set %spin.nick $gettok(%play.list,$rand(1,$numtok(%play.list,44)),44) }
set %spin.last $nick
.timer 1 1 describe # 5 grins as $nick spins the bottle...
.timer 1 3 describe # 5 gasps happily as it halts, pointing to %spin.nick
.timer 1 5 describe # 5 %spin.nick $+ , Truth, Dare, $nick $+ 's choice, or !choose
.timer 1 6 .notice %spin.nick 4You were picked! Truth, Dare, $nick $+ 's Choice, or !choose?
halt
}
}
if $numtok(%play.list,44) == 2 {
set %spin.nick %cheat
set %spin.last $nick
describe # 5 looks at %spin.nick $+ , and says " $+ $nick wishes to know 'Truth, Dare, $nick $+ 's Choice, or $me $+ 's choice with !choose?"
.timer 1 3 .notice %spin.nick 4You were picked! Truth, Dare, $nick $+ 's Choice, or !choose?
halt
}
else {
set %spin.nick %cheat
set %spin.last $nick
.timer 1 1 describe # 5 grins as $nick spins the bottle...
.timer 1 3 describe # 5 gasps happily as it halts, pointing to %spin.nick
.timer 1 5 describe # 5 %spin.nick $+ , Truth, Dare, $nick $+ 's Choice, or !choose?
.timer 1 6 .notice %spin.nick 4You were picked! Truth, Dare, $nick $+ 's Choice, or !choose?
halt
}
}
}
on $10:text:/!c[dt] /i:?:{
var %a = $mid($1,2) $+ .txt,%b = $remove(cd.txtct.txt,%a), $&
%c = $iif(%a = ct.txt,truthed,dared),%n = .notice $nick $2
if (!$2) && ($1 == !ct) { .play $nick ct.txt 2000 }
elseif (!$2) && ($1 == !cd) { .play $nick cd.txt 2000 }
else {
if ($read(%a,w,$2)) {
write -dl $readn %a
%n is no longer being %c
halt
}
if ($read(%b,w,$2)) {
write -dl $readn %b
%n is no longer being $remove(trutheddared,%c)
}
write %a $2
%n has been %c
}
}
on *:TEXT:!choose:#:{
if $read(cd.txt,w,$nick) { set %choice B }
elseif $read(ct.txt,w,$nick) { set %choice A }
else { set %choice $rand(A,B) }
if (%choice == A) {
set %choice Truth
set %spin.nick_choice T
write -sTruth choose.txt Truth $calc(1 + $read(choose.txt,s,Truth))
write choose.txt Truth $fulldate %spin.nick
}
else {
set %choice Dare
set %spin.nick_choice D
write -sDare choose.txt Dare $calc(1 + $read(choose.txt,s,Dare))
write choose.txt Dare $fulldate %spin.nick
}
describe # 5 randomly picks %choice for4 %spin.nick
//echo # Truth $read(choose.txt,s,Truth), Dare $read(choose.txt,s,Dare)
}
[suggestions]
on *:text:!& &:#:{
if ($left($1,2) == !s) {
if ($2 == Truth) || ($2 == Dare) {
if ($($+(%,$2,line),2) == $($+(%old,$2),2)) set $+(%,$2,line) $rand(1,$lines($+($2,.txt)))
describe $chan suggests $read($+($2,.txt),$($+(%,$2,line),2))
set %old $2
set % $+ $2 $+ line $rand(1,$lines($2 $+ .txt))
}
}
}
[lists]
/*
on *:text:!*list &:*:{
set %file $iif((Truth isin $1) || (Dare isin $1),$+($v1,.txt))
if (!$2) {
if ($play(1)) { msg $nick The $right($1,-1) is on it's way. Please be patient as someone else may be viewing it }
else { .play $nick %file 2000 | .unset %file }
}
elseif $2 > $lines(%file) { .notice $nick Sorry, but $v1 number $2 doesn't exist }
else describe %td.chan $read(%file,$2)
}
*/
on *:text:!darelist &:*:{
if $2 == $null .play $nick dare.txt
else describe %td.chan $read(dare.txt,$2)
}
on *:text:!truthlist &:*:{
if $2 == $null .play $nick truth.txt
else describe %td.chan $read(truth.txt,$2)
}
[timers]
on *:TEXT:!timer*:*:{
if (!$2) && !$timer(0) {
.msg $nick There are no timers active
halt
}
elseif ($2 isnum) && ($2 <= $timer(0)) {
if $+($timer,$chr(40),$2,$chr(41)) == checkconnect { halt }
else {
.timer $+ $2 off
describe $chan anounces that Timer $+($chr(35),$2) has been stopped by $nick
}
}
else {
var %timer_count = 1
while %timer_count <= $timer(0) {
if $timer(%timer_count) isnum { .msg $nick Timer $chr(35) %timer_count $duration($timer(%timer_count).secs) remaining }
inc %timer_count 1
}
}
}
on 10:TEXT:!truthfor & *:#:{
set %spinnick_choice t
set %truthnick $2
describe # 5 Watches as 1 $nick sets the egg timer to 4 $duration(%truthtime) for 12 %truthnick $+ 's truth, " $3- "
.splay -p (C:\My Shared Folder\MP3\Jeopardy Think Music.mp3)
timer 1 300 describe # 5 hears the egg timer ding, time up for %truthnick $+ 's truth, " $3- "
}
on *:TEXT:!truth *:#:{
set %spinnick_choice t
if ($nick == %spin.last) {
set %truthnick %spin.nick
describe # 5 Watches as 1 $nick sets the egg timer to 4 5mins for 12 %truthnick $+ 's truth, " $2- "
.splay -p (C:\My Shared Folder\MP3\Jeopardy Think Music.mp3)
timer 1 300 describe # 5 hears the egg timer ding, time up for %truthnick $+ 's truth, " $2- "
}
else if ($nick != %spin.nick) { describe # 5 looks to $nick and laughs... "Sorry, you were not the one that spun the bottle" }
}
on 10:TEXT:!darefor*:#:{
if (!$2) && $len($1) = 8 {
.msg $nick Use !darefor <time> <nick> <dare>
.msg $nick <time> can be in minutes or HH:MM:SS format
}
else {
set %spinnick_choice d
set %darenick $2
set %dare $iif(($1 == !darefor), $2-, $remove($$1-,!darefor))
if istok(%dare,%darenick,44) { set %dare $remtok(%dare,%darenick,1,44) }
tokenize 32 %dare
if ($1 isnum) { set %daretime $calc(60 * $1) }
elseif ($numtok($1,58)) { set %daretime $iif($numtok($1,58) = 1,$calc(60 * $duration($1)),$duration($1)) }
else set %daretime 900
describe # 5 Watches as 1 $nick sets the egg timer to 4 $duration(%daretime) for 12 %darenick $+ 's dare, " $2- "
timer 1 %daretime describe # 5 hears the egg timer ding, time up for %darenick $+ 's dare, " $2- "
}
}
on *:TEXT:!dare*:#:{
set %spinnick_choice d
if ($nick == %spin.last) {
set %darenick %spin.nick
set %dare $iif(($1 == !dare),$2-, $remove($$1-,!dare))
if $istok(%dare,%darenick,32) { set %dare $remtok(%dare,%darenick,1,32) }
if $numtok(%dare,32) = 1 { set %dare $instok(%dare,15,1,32) }
tokenize 32 %dare
if ($1 isnum) { set %daretime $calc(60 * $1) }
elseif ($numtok($1,58)) { set %daretime $iif($numtok($1,58) = 1,$calc(60 * $duration($1)),$duration($1)) }
describe # 5 Watches as 1 $nick sets the egg timer to 4 $duration(%daretime) for 12 %darenick $+ 's dare, " $2- "
timer 1 %daretime describe # 5 hears the egg timer ding, time up for %darenick $+ 's dare, " $2- "
}
else if ($nick != %spin.nick) { describe # 5 looks to $nick and laughs... "Sorry, you were not the one that spun the bottle" }
}
#td2 end
I know that there's some duplication in the script, but that's due to a quick fix on the current problem
|