Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:TEXT:!*:%spl.chan: {
- if ($1 == !showteam) && ($findtok(%spl.teams,$2,1,32)) {
- msg $iif($chan,$chan,$nick) $getfullname($2) Credits: $getcredits($2) $chr(124) Bidders: $getbidders($2) $chr(124) Players: $getplayers($2)
- }
- if ($chan) {
- if (($1 == !withdraw) && (%spl.active == 1) && ($getbidderteam($nick) == $getcurrteam)) {
- if ($getnumplayers($getcurrteam) < 8) {
- msg $chan $+ %colour $+ Team must have purchased 8 players before withdrawing.
- return
- }
- set %spl.skip $puttok(%spl.skip,0,$getteam($getcurrteam),32)
- msg $chan $getfullname($getcurrteam) have withdrawn from the auction.
- msg $chan $getfullname($getnext) up to nominate. Bidders: $getbidders($getcurrteam)
- }
- if (($1 == !nominate) && (%spl.active == 1) && ($getbidderteam($nick) == $getcurrteam)) {
- if ($read(spl.txt,s,$replace($2-,$chr(32),\))) {
- if ($findtok(%spl.bought,$replace($2-,$chr(32),\),1,58)) {
- msg $chan $+ %colour $+ $+ $2- has already been sold.
- return
- }
- msg $chan $+ %colour $+ $getplayerdata($replace($gettok($read(spl.txt,$readn),1,32),$chr(32),\))
- set %spl.nominated $gettok($read(spl.txt,$readn),1,32)
- set %spl.active 2
- set %spl.highbid 3000
- set %spl.highbidteam $getcurrteam
- msg $chan $getfullname($getbidderteam($nick)) $+ : 3000
- set %spl.bids $puttok(%spl.bids,%spl.highbid,$getteam($getbidderteam($nick)),32)
- .timerinitial 1 %spl.time lastten
- }
- else {
- msg $chan $getfullname($getbidderteam($nick)) $+ : Player " $+ $2- $+ " not found.
- }
- }
- if ((($left($right($1,-1),1) isnum) || ($left($right($1,-1),1) == +)) && (%spl.active == 2)) {
- if ($isbidder($nick)) {
- if (!$gettok(%spl.skip,$getteam($getbidderteam($nick)),32)) {
- return
- }
- var %bid $processbid($right($1,-1))
- if (!%bid) {
- msg $chan $getfullname($getbidderteam($nick)) $+ : Invalid bid amount.
- return
- }
- if (($right(%bid,3) != 000) && ($right(%bid,3) != 500)) {
- msg $chan $getfullname($getbidderteam($nick)) $+ : Only bids that are multiples of 500 are accepted.
- return
- }
- if (%bid > $getmaxbid($getbidderteam($nick))) {
- msg $chan $getfullname($getbidderteam($nick)) $+ : Bid exceeds max bid of $getmaxbid($getbidderteam($nick)) $+ .
- return
- }
- if (%bid < $calc(%spl.highbid + 500)) {
- msg $chan $getfullname($getbidderteam($nick)) $+ : Bid must be at least 500 above %spl.highbid $+ .
- return
- }
- set %spl.highbid %bid
- set %spl.highbidteam $getbidderteam($nick)
- set %spl.bids $puttok(%spl.bids,%bid,$getteam($getbidderteam($nick)),32)
- msg $chan $getfullname($getbidderteam($nick)) $+ : %bid
- if (%spl.10) {
- lastten
- }
- }
- }
- if (($address($nick,2) == *!*@2D1F4400.510A082A.D7B32989.IP) || ($address($nick,2) == *!*@synIRC-3311CCBF.user.veloxzone.com.br)) {
- if ($1 == !showall) {
- var %i 1
- while (%i <= $numtok(%spl.teams,32)) {
- msg $chan $getfullname($gettok(%spl.teams,%i,32)) Credits: $getcredits($gettok(%spl.teams,%i,32)) $+ $chr(124) Bidders: $getbidders($gettok(%spl.teams,%i,32)) $chr(124) Players: $getplayers($gettok(%spl.teams,%i,32))
- inc %i
- }
- }
- if (($1 == !setchan) && ($2)) {
- join $2
- set %spl.chan $2
- msg $chan $+ %colour $+ Commands will now function only in $2 $+ .
- }
- if (($1 == !addcredits) && ($findtok(%spl.teams,$2,1,32)) && ($3 isnum)) {
- set %spl.credits $puttok(%spl.credits,$calc($getcredits($2) + $3),$getteam($2),32)
- msg $chan $+ %colour $+ $+ $3 credits added to $getfullname($2) $+ .
- }
- if (($1 == !addretainer) && ($findtok(%spl.teams,$2,1,32)) && ($3 isnum) && ($4-)) {
- if ($read(spl.txt,s,$replace($4-,$chr(32),\))) {
- set %spl.credits $puttok(%spl.credits,$calc($getcredits($2) - $3),$getteam($2),32)
- set %spl.players $puttok(%spl.players,$addtok($gettok(%spl.players,$getteam($2),32),$replace($4-,$chr(32),\),44),$getteam($2),32)
- set %spl.bought %spl.bought $+ : $+ $replace($4-,$chr(32),\)
- set %spl.prices %spl.prices $+ : $+ $3
- set %spl.crspndteam %spl.crspndteam $+ : $+ $2
- msg $chan $+ %colour $+ $+ $replace($4-,\,$chr(32)) retained by $getfullname($2) for $3 $+ .
- }
- else {
- msg $chan $getfullname($2) $+ : Player " $+ $4- $+ " not found.
- }
- }
- if (($1 == !settimer) && ($2 isnum)) {
- set %spl.time $2
- msg $chan $+ %colour $+ Initial timer changed to $2 seconds.
- }
- if ($1 == !undobid) {
- msg $chan $+ %colour $+ The highest bid has been forcefully retracted.
- set %spl.highbid $gettok($sorttok(%spl.bids,32,nr),2,32)
- set %spl.highbidteam $gettok(%spl.teams,$findtok(%spl.bids,%spl.highbid,1,32),32)
- msg $chan $getfullname(%spl.highbidteam) $+ : %spl.highbid
- }
- if (($1 == !pause) && (%spl.active >= 1)) {
- turntimersoff
- msg $chan $+ %colour $+ The auction has been paused.
- set %spl.active 4 %spl.active
- }
- if (($1 == !resume) && ($gettok(%spl.active,1,32) == 4)) {
- set %spl.active $gettok(%spl.active,2,32)
- msg $chan $+ %colour $+ The auction has been resumed.
- if (%spl.active == 2) {
- .timerinitial 1 %spl.time lastten
- msg $chan $getfullname(%spl.highbidteam) $+ : %spl.highbid
- }
- else if (%spl.active == 3) {
- .timercont 1 3 nextbidding
- }
- }
- if (($1 == !start) && (!%spl.active)) {
- msg $chan $getfullname($getnext) up to nominate. Bidders: $getbidders($getcurrteam)
- set %spl.active 1
- }
- if (($1 == !next) && (%spl.active)) {
- msg $chan $+ %colour $+ Skipping to next team.
- msg $chan $getfullname($getnext) up to nominate. Bidders: $getbidders($getcurrteam)
- set %spl.active 1
- turntimersoff
- }
- if ($1 == !reset) {
- unset %spl.*
- set %spl.teams cru hun gam str que wai rid cel
- set %spl.credits 120000 120000 120000 120000 120000 120000 120000 120000
- set %spl.bidders . . . . . . . .
- set %spl.players ^ ^ ^ ^ ^ ^ ^ ^
- set %spl.bids 0 0 0 0 0 0 0 0
- set %spl.skip 1 1 1 1 1 1 1 1
- set %spl.currbid 0
- set %spl.currdir 1
- set %spl.time 20
- set %spl.chan $chan
- turntimersoff
- msg $chan $+ %colour $+ All details have been reset.
- }
- if ((($1 == !setcolour) || ($1 == !setcolor)) && ($2 isnum)) {
- if ($len($2) == 2) {
- set %colour $2
- }
- else {
- set %colour 0 $+ $2
- }
- msg $chan $+ %colour $+ Text colour changed.
- }
- if (($1 == !addbidder) && ($findtok(%spl.teams,$2,1,32)) && ($3)) {
- if ($isbidder($3)) {
- msg $chan $+ %colour $+ $3 is already a bidder for $getfullname($getbidderteam($3)) $+ .
- return
- }
- set %spl.bidders $puttok(%spl.bidders,$addtok($gettok(%spl.bidders,$getteam($2),32),$3,44),$getteam($2),32)
- msg $chan $+ %colour $+ $3 added to bidders for $getfullname($2) $+ . Bidders: $getbidders($2)
- }
- if (($1 == !removebidder) && ($findtok(%spl.teams,$2,1,32)) && ($3) && ($3 != .)) {
- if (!$findtok($gettok(%spl.bidders,$getteam($2),32),$3,1,44)) {
- msg $chan $+ %colour $+ $3 is not a bidder for $getfullname($2) $+ . Bidders: $getbidders($2)
- return
- }
- set %spl.bidders $puttok(%spl.bidders,$remtok($gettok(%spl.bidders,$getteam($2),32),$3,1,44),$getteam($2),32)
- msg $chan $+ %colour $+ $3 removed from bidders for $getfullname($2) $+ . Bidders: $getbidders($2)
- }
- }
- }
- }
- alias getteam {
- return $findtok(%spl.teams,$1,1,32)
- }
- alias getfullname {
- if ($1 == cru) { return 7The Black City Crushers $+ %colour }
- if ($1 == hun) { return 6The Distortion World Hunters $+ %colour }
- if ($1 == gam) { return 12The Game Corner Gamblers $+ %colour }
- if ($1 == str) { return 9The Goldenrod Strikers $+ %colour }
- if ($1 == que) { return 14The Snowpoint Queens $+ %colour }
- if ($1 == wai) { return 11The Celadon Waitresses $+ %colour }
- if ($1 == rid) { return 1The Sky Pillar Riders $+ %colour }
- if ($1 == cel) { return 2The Slowpoke Well Celebrities $+ %colour }
- }
- alias getbidders {
- return $replace($gettok(%spl.bidders,$getteam($1),32),. $+ $chr(44),$chr(32),.,$chr(32),$chr(44),$chr(32) / $chr(32))
- }
- alias getcredits {
- return $gettok(%spl.credits,$getteam($1),32)
- }
- alias getplayers {
- return $replace($gettok(%spl.players,$getteam($1),32),\,$chr(32),^ $+ $chr(44),$chr(32),^,$chr(32),$chr(44),$chr(32) / $chr(32))
- }
- alias getcurrteam {
- return $gettok(%spl.teams,%spl.currbid,32)
- }
- alias getnext {
- set %spl.currbid $calc(%spl.currbid + %spl.currdir)
- if (%spl.currbid == 9) {
- set %spl.currbid 8
- set %spl.currdir -1
- }
- else if (%spl.currbid == 0) {
- set %spl.currbid 1
- set %spl.currdir 1
- }
- var %count 0
- while ($gettok(%spl.skip,$getteam($getcurrteam),32) == 0) {
- set %spl.currbid $calc(%spl.currbid + %spl.currdir)
- if (%spl.currbid == 7) {
- set %spl.currbid 6
- set %spl.currdir -1
- }
- else if (%spl.currbid == 0) {
- set %spl.currbid 1
- set %spl.currdir 1
- }
- inc %count
- if (%count == 12) {
- endauction
- halt
- }
- }
- return $gettok(%spl.teams,%spl.currbid,32)
- }
- alias isbidder {
- var %i 1
- while (%i <= 8) {
- if ($findtok($gettok(%spl.bidders,%i,32),$1,1,44)) {
- return $true
- }
- inc %i
- }
- return $false
- }
- alias processbid {
- ; if ($left($1,1) == +) {
- ; var %pbid $right($1,-1)
- ; var %pbid $processplusbid(%pbid)
- ; if (%pbid == 0) {
- ; return 0
- ; }
- ; var %mbid %spl.highbid
- ; }
- ; else {
- var %pbid 0
- var %mbid $1
- ; }
- if (%mbid isnum 3-94) {
- return $iif($numtok($calc(%mbid * 1000),46) == 1,$calc(%mbid * 1000 + %pbid),0)
- }
- else if (%mbid isnum 3000-94000) {
- return $iif($numtok(%mbid,46) == 1,$calc(%mbid + %pbid),0)
- }
- else if ($right(%mbid,1) == k) {
- var %kbid $left(%mbid,-1)
- if (%kbid isnum 3-94) {
- return $iif($numtok($calc(%kbid * 1000),46) == 1,$calc(%kbid * 1000 + %pbid),0)
- }
- }
- return 0
- }
- alias processplusbid {
- if ($left($1,1) == +) {
- return 0
- }
- else {
- var %pbid 0
- var %mbid $1
- }
- if (%mbid isnum 0.5-94) {
- return $iif($numtok($calc(%mbid * 1000),46) == 1,$calc(%mbid * 1000 + %pbid),0)
- }
- else if (%mbid isnum 500-94000) {
- return $iif($numtok(%mbid,46) == 1,$calc(%mbid + %pbid),0)
- }
- else if ($right(%mbid,1) == k) {
- var %kbid $left(%mbid,-1)
- if (%kbid isnum 0.5-94) {
- return $iif($numtok($calc(%kbid * 1000),46) == 1,$calc(%kbid * 1000 + %pbid),0)
- }
- }
- return 0
- }
- alias getbidderteam {
- var %i 1
- while (%i <= 8) {
- if ($findtok($gettok(%spl.bidders,%i,32),$1,1,44)) {
- return $gettok(%spl.teams,%i,32)
- }
- inc %i
- }
- }
- alias getnumplayers {
- return $calc($numtok($gettok(%spl.players,$getteam($1),32),44) - 1)
- }
- alias getmaxbid {
- return $calc($getcredits($1) - ($iif($calc(7 - $getnumplayers($1)) >= 0,$calc(7 - $getnumplayers($1)),0) * 3000))
- }
- alias getplayerdata {
- var %metagames ORAS_OU ORAS_UBER ORAS_UU ORAS_RU ORAS_NU BW_OU DPP_OU
- var %i 1
- var %data $read(spl.txt,s,$1)
- while (%i <= 7) {
- if (y isin $gettok(%data,%i,58)) {
- var %mplayed %mplayed $replace($gettok(%metagames,%i,32),_,$chr(32)) /
- }
- inc %i
- }
- var %mplayed $deltok(%mplayed,$numtok(%mplayed,32),32)
- return $+ $replace($1,\,$chr(32)) is up for auction. Metagames: %mplayed
- }
- alias lastten {
- .timerfive off
- .timerten off
- set %spl.10 1
- .timerten 1 10 endbidding
- .timerfive 1 5 msg %spl.chan $+ %colour $+ 5 seconds remaining.
- }
- alias endbidding {
- msg %spl.chan $+ %colour $+ SOLD: $replace(%spl.nominated,\,$chr(32)) to $getfullname(%spl.highbidteam) for %spl.highbid $+ .
- set %spl.credits $puttok(%spl.credits,$calc($getcredits(%spl.highbidteam) - %spl.highbid),$getteam(%spl.highbidteam),32)
- set %spl.players $puttok(%spl.players,$addtok($gettok(%spl.players,$getteam(%spl.highbidteam),32),$replace(%spl.nominated,$chr(32),\),44),$getteam(%spl.highbidteam),32)
- set %spl.active 3
- set %spl.bids 0 0 0 0 0 0 0 0
- unset %spl.10
- set %spl.bought %spl.bought $+ : $+ %spl.nominated
- set %spl.prices %spl.prices $+ : $+ %spl.highbid
- set %spl.crspndteam %spl.crspndteam $+ : $+ %spl.highbidteam
- if ($getcredits(%spl.highbidteam) < 3000) {
- set %spl.skip $puttok(%spl.skip,0,$getteam(%spl.highbidteam),32)
- }
- .timercont 1 8 nextbidding
- }
- alias nextbidding {
- var %i 1
- while (%i <= $numtok(%spl.teams,32)) {
- msg %spl.chan $getfullname($gettok(%spl.teams,%i,32)) Credits: $getcredits($gettok(%spl.teams,%i,32)) $+ $chr(124) Players: $getplayers($gettok(%spl.teams,%i,32))
- inc %i
- }
- msg %spl.chan $getfullname($getnext) up to nominate. Bidders: $getbidders($getcurrteam)
- set %spl.active 1
- }
- alias endauction {
- msg %spl.chan $+ %colour $+ The auction has officially ended.
- turntimersoff
- outputtofile
- }
- alias turntimersoff {
- .timercont off
- .timerten off
- .timerfive off
- .timerinitial off
- }
- alias outputtofile {
- write splrecord.txt -----
- write splrecord.txt -----
- write splrecord.txt -----
- write splrecord.txt -----
- write splrecord.txt -----
- write splrecord.txt Log for auction that concluded at $fulldate in %spl.chan
- var %i 1
- var %num $numtok(%spl.bought,58)
- while (%i <= %num) {
- write splrecord.txt $replace($gettok(%spl.bought,%i,58),\,$chr(32)) $+ : $gettok(%spl.prices,%i,58) ( $+ $strip($getfullname($gettok(%spl.crspndteam,%i,58))) $+ )
- inc %i
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement