Alog Alias.
Uses Runescript parsers (thanks guys!)
type /alog to use!
that's about it
:)
leave me a memo on SwiftIRC if ya want to tell me about it, or join #savage_CL on said network :P
;Alog Script
alias alog {
if ($1 != $null) {
set %name $replace($1-,$chr(32),$chr(95))
echo -a Please Wait...
sockopen alog rscript.org 80
}
else { $input(You must enter an RSN!,wo,Adventurer's Log) }
}
on *:SOCKOPEN:alog:{
sockwrite -n $sockname GET $+(/lookup.php?type=alog&user=,%name) HTTP/1.0
sockwrite -n $sockname Host: www.rscript.org $+ $crlf $+ $crlf
}
on *:SOCKREAD:alog:{
if ($sockerr) return
sockread %t
while ($sockbr) {
tokenize 32 %t
if ($left($1,9) == ACTIVITY:) { set %temp $2- | goto end }
elseif ($left($1,6) == ERROR:) { echo 9 -aei3 $2- | HALT }
else { sockread %t }
}
:end
sockclose alog
parser %temp
}
alias -l parser {
echo 13 -a Adventurer's Log data for: %name
var %data $1-
tokenize 59 %data
var %total $0
var %temp 1
while (%temp <= %total) {
tokenize 124 [ $ $+ [ %temp ] ]
var %date $+($left($2,3),$chr(32),$right($2,-3))
echo -a 4 %date $+ : 9 $1
tokenize 59 %data
inc %temp
}
unset %temp
unset %t
unset %name
echo -a DONE!
}
You sounded as if you have blown a fuse, Savage. I think proborski was asking for this code to be triggered by other people, which, in turn, it's not hard to do so to call the alias and be triggered by a text event. proborski just didn't know how, and that's why he asked for help.
P.S. you call yourself a savage, so I'm unaware whether you're easily provoked....:p
isnt there a way to put alog like this
...code...
so everyone on swiftirc.net are abble to check aswell?
There are some things I need to say about this:
I don't use regex
I don't rewrite your codes, don't rewrite mine. I'll take suggestions but that's a bit much
$getsource is not a valid identifier, nor will it be, because Identifiers can only return one line
The description clearly states that this is an ALIAS
You aren't on swiftirc.net, that is a website.
You are either on SwiftIRC (the network) or irc.swiftirc.net (the global server url)
isnt there a way to put alog like this
on $*:TEXT:/^[!@.]alog/Si:#: {
var %o = $iif($left($1,1) == @,msg #,.notice $nick)
var %q = $getsource(http://rscript.org/lookup.php?type=alog&user= $+ $iif($2,$2,%defname [ $+ [ $address($nick,3) ] ]))
echo -a %q
%o %q
}
so everyone on swiftirc.net are abble to check aswell?
You're encouraged to use the sockmark and $sock().mark instead of setting global variables here and there, then having them unset at the end.
Using /sockmark puts the data in a temporary storage for later reference with $sock().mark, and the storage space is eliminated by itself after socket has finished its required task.