alias changeing {
hmake changing 5
}
alias start {
hmake skiller 5 | hmake players 5 | hmake change 5 | hmake active 5 | hmake changing 5
if ($isfile(players.htb)) hload players players.htb
if ($isfile(change.htb)) hload change change.htb
if ($isfile(skill.htb)) hload skiller.htb
if ($isfile(active.htb)) hload active active.htb
if ($isfile(changing.htb)) hload changing changing.htb
echo 3 -ea * /startpc: pc script has been started
}
on *:start: {
hmake skiller 5 | hmake players 5 | hmake change 5 | hmake active 5 | hmake changing 5
if ($isfile(players.htb)) hload players players.htb
if ($isfile(change.htb)) hload change change.htb
if ($isfile(skill.htb)) hload skiller.htb
if ($isfile(active.htb)) hload active active.htb
if ($isfile(changing.htb)) hload changing changing.htb
echo 3 -ea * /startpc: pc script has been started
}
on *:QUIT: {
if ($nick == $me) {
hsave -o change change.htb
hfree change
hsave -o skill skill.htb
hfree skill
echo 4 -ea * /stoppc: pc has been closed
ame has closed the pc!
}
elseif ($hget(players,$nick) != $null) {
hdel players $nick $nick
hdel active $nick $nick
}
}
on *:TEXT:!onchanging:#: {
if ($nick !isreg $chan) {
set %heart on
}
}
on *:TEXT:!offchanging:#: {
if ($nick !isreg $chan) {
set %heart off
}
}
on *:text:!setchange*:#: {
if ($nick !isreg $chan) {
hadd change $nick $2- | notice $nick $2- | hsave -o change change.htb
}
}
on *:TEXT:!change*:#: {
if ($chan == #heart ) {
if (%heart == on ) {
if ($nick !isreg $chan) {
if ($hget(change,$nick) == $null) { timer 1 1 msg $chan Attention: 4new world http://heartunit.org/forums/index.php?showtopic=3. Set by: $nick Scouted by: $2 |timer 1 2 msg $chan Attention: 6new world http://heartunit.org/forums/index.php?showtopic=3. Set by: $nick Scouted by: $2 | timer 1 3 msg $chan Attention: 7new world http://heartunit.org/forums/index.php?showtopic=3. Set by: $nick Scouted by: $2 | timer 1 4 msg $chan Attention: 12new world http://heartunit.org/forums/index.php?showtopic=3. Set by: $nick Scouted by: $2 | timer 1 5 msg $chan Attention: 5new world http://heartunit.org/forums/index.php?showtopic=3. Set by: $nick Scouted by: $2 |
timer 1 $calc( 5 * 60 ) msg $chan 8The world changed 5 min ago make sure you are there. | timer 1 $calc( 5 * 60 ) msg $chan 4The world changed 5 min ago make sure you are there.
}
else timer 5 0 msg $chan $gettok($hget(change,$nick),1,2) Scouted by: $2 Set by: $nick | timer 1 $calc( 5 * 60 ) msg $chan 8The world changed 5 min ago make sure you are there. | timer 1 $calc( 5 * 60 ) msg $chan 4The world changed 5 min ago make sure you are there.
}
else notice $nick you must become active to use the change command.
}
}
}
on *:text:!onpc*:#fireworkingarea: {
if ($2 == $null) { notice $nick you need to specify a pc skill to train. IE: !onpc str
}
elseif ($hget(players,$nick) == $null) { hadd players $nick $nick | hadd skiller $nick $2 | notice $nick you have been added to the members playing pc and your skill is set to $hget(skiller,$nick) $+ .
}
else notice $nick you are already on my active members list.
}
on *:TEXT:!offpc:#fireworkingarea: {
if ($hget(players,$nick) == $null) { notice $nick you are not playing pc, so I can't take him off the active members list!
}
else hdel players $nick $nick | hdel skiller $nick $hget(skiller,$nick) | notice $nick you have has been taken off the active members list.
}
on *:TEXT:!members:#fireworkingarea: {
if ($nick !isreg $chan) {
var %i = 0
var %t = $hget(players,0).item
while (%i < %t) {
inc %i
var %list = $addtok(%list,$hget(players,%i).item,32)
}
if (%list != $null) { notice $nick the active members are: $addtok(%list,$hget(players,%i).item,32)
}
else notice $nick there is no one playing pc right now.
}
else notice $nick you must have at least voice to use the command.
}
on *:text:!onact:#fireworkingarea: {
if ($nick !isreg $chan) {
if ($hget(active,$nick) == $null) { hadd active $nick $nick | notice $nick you have been added to active staff list. | halt
}
else notice $nick you are already on my active staff list. | halt
}
else notice $nick you cannot do that you are not staff. | halt
}
on *:TEXT:!offact:#fireworkingarea: {
if ($nick !isreg $chan) {
if ($hget(active,$nick) == $null) { notice $nick you are not set to change a world, so I can't take him off the active staff list! | halt
}
else hdel active $nick $nick | notice $nick you have been taken off the active staff list. | halt
}
else notice $nick you cannot do that you are not staff. | halt
}
on *:TEXT:!active:#fireworkingarea: {
var %i = 0
var %t = $hget(active,0).item
while (%i < %t) {
inc %i
var %list = $addtok(%list,$hget(active,%i).item,32)
var %clist = $addtok(%clist,$hget(changing,%i).item,32)
}
if (%list != $null) { notice $nick the active staff is/are: $addtok(%list,$hget(active,%i).item,32) The changing staff is: $addtok(%clist,$hget(changing,%i).item,32)
}
else notice $nick there is no one active to set a world right now.
}
on *:part:#fireworkingarea: {
if ($hget(players,$nick) != $null || $hget(active,$nick) != $null) {
hdel players $nick $nick
hdel active $nick $nick
}
}
on *:text:!setworld*:#fireworkingarea: {
if ($hget(active,$nick) != $null) {
if ($2 isnum 2-138) {
writeini oldworld.ini [ $+ [ $chan ] ] world world $readini(newworld.ini [ $+ [ $chan ] ],world,world)
writeini newworld.ini [ $+ [ $chan ] ] world world $2
notice $nick the world has changed Please Check the world by using the command !world
}
else notice $nick did you make a new world and not tell anyone?
}
else notice $nick you need to have vho to use this command
}
on *:text:!oldworld:#fireworkingarea: {
notice $nick the pure world is4 $readini(oldworld.ini [ $+ [ $chan ] ],world,world) Please make sure you only bring your pures to the old world. ty
}
on $*:text:/^[@!.]world/Si:#fireworkingarea: {
if ($hget(players,$nick) != $null || $hget(active,$nick) != $null) {
if ($getskill($hget(skiller,$nick))) {
var %x = 1
while ($sock(pc. $+ %x)) {
inc %x
}
set %target. $+ %x $iif($left($1,1) == @,notice $nick,.notice $nick)
set %rsn. $+ %x $nick
set %skill. $+ %x $getskill($hget(skiller,$nick),1,32)
set %nworld. $+ %x $readini(newworld.ini [ $+ [ $chan ] ],world,world)
sockopen pc. $+ %x www.o-ss.net 80
halt
}
else msg $chan getskill error
}
else msg $chan please use the !onpc <skill> command to see the world
}
alias -l cleanup {
sockclose $1
unset %level. $+ $right($1,1)
unset %target. $+ $right($1,1)
unset %rsn. $+ $right($1,1)
unset %skill. $+ $right($1,1)
}
on *:sockopen:pc.*: {
var %x = $right($sockname,1)
if ($sockerr > 0) return
sockwrite -nt $sockname GET $+(/parsers/skills.php?user=,%rsn. [ $+ [ %x ] ],&skill=,%skill. [ $+ [ %x ] ]) HTTP/1.1
sockwrite -nt $sockname Host: www.o-ss.net
sockwrite -nt $sockname $crlf $crlf
}
on *:sockread:pc.*: {
if ($sockerr) return
var %x = $right($sockname,1)
var %read | /sockread %read
tokenize 32 %read
if ($0 == 4) { %target. [ $+ [ %x ] ] Current world is4 %nworld. [ $+ [ %x ] ] you are trainging4 %skill. [ $+ [ %x ] ] $+ . points till level $iif(%level. [ $+ [ %x ] ],%level. [ $+ [ %x ] ],$calc(($2)+1)) $+ : $iif(%level. [ $+ [ %x ] ],$pestget(%skill. [ $+ [ %x ] ],%level. [ $+ [ %x ] ],$calc($xp(%level. [ $+ [ %x ] ])-($remove($3,$chr(44))))),$pestget(%skill. [ $+ [ %x ] ],$calc(($2)+1),$calc($xp($calc($2 + 1))- $remove($3,$chr(44))))) | /cleanup $sockname }
}
alias -l getskill {
if ($regex($1,/^at(t|k|tack)?/Si)) return Attack
elseif ($regex($1,/^def(en[cs]e)?/Si)) return Defence
elseif ($regex($1,/^hp|hit(s|points?)?/Si)) return Hitpoints
elseif ($regex($1,/^range(r|d|ing)?/Si)) return Ranged
elseif ($regex($1,/^Pray(er)?/Si)) return Prayer
elseif ($regex($1,/^mag(e|ic)?/Si)) return Magic
elseif ($regex($1,/^str(ength)?/Si)) return Strength
}
alias /pest {
var %type = $iif($1 == prayer,12,6)
return $ceil($calc(($2)*($2)/(%type)))
}
alias /pestget {
var %skill = $1
var %exp = $remove($3,$chr(44))
var %level = $2
var %gstring = $pest(%skill,%level)
return $bytes($ceil($calc((%exp)/(%gstring))),b)
}
alias /xp {
var %x = 1, %level = $calc($1 - 1), %xp = 0
while (%x <= %level) {
var %tempxp = $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4)
inc %xp %tempxp
inc %x
}
return $int(%xp)
}