Ok, i have been a user of mIRC for a very long time and has always been a wannabe *nix user and always out to broaden my knowledge of things.
Now i have found eggdrop and tried alot of scripts and worked my way around to customise it.
The problem i got now is that i have forgotten how the heck i made my mIRC script work and dont have a clue on how to proceed to convert it to TCL even if they are both quite similar to eachoter.
What this script does then?
1. Channel user types " !akfind keyword" in channel.
2. Script recognizes it.
3. Script connects to server and gets information depending on keywords.
4. The page is loaded and gives results according to keywords.
5. Script saves a temp file with information.
6. Script notices user the results from the find.
7. Script deletes temp file.
What i cant seem to figure out is the delay on notice and posting multiple lines of information to user.
I would appreciate a complete conversion of this and i would appreciate it even more if i got alot of hints and tips instead, on how to proceed with this!
Btw, i have searched this place, the all knowing google and some other resources too but failed.
Here is the mIRC script:
Code: Select all
alias akfind {
var %sockname = $+(akfinder.,$ctime,.,$replace($1-,$chr(32),.))
if ($sock(%sockname)) { return }
sockopen %sockname localhost 80
sockmark %sockname http_connect $1 $2-
}
on *:text:.akfind *:#:{
akfind $nick $2-
}
on *:sockopen:akfinder.*:{
tokenize 32 $sock($sockname).mark
sockwrite -n $sockname GET /irc.asp?get= $+ $replace($3-,$chr(32),$+($chr(37),20)) HTTP/1.0
sockwrite -n $sockname Host: localhost
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
}
on *:sockread:akfinder.*:{
tokenize 32 $sock($sockname).mark
var %tmp
sockread %tmp
if ($1 == http_connect) {
if (!%tmp) { sockmark $sockname http_read $2- }
}
elseif ($1 == http_read) {
if (%tmp == ---- start of find ----) { sockmark $sockname http_read_send $2- }
}
elseif ($1 == http_read_send) {
if (%tmp == ---- eof of Find ----) { sockmark $sockname http_read $2- }
else { write $+(tmpdata,$2) $2 $iif($remove(%tmp,-),$ifmatch,-) }
}
}
on *:sockclose:akfinder.*:{
tokenize 32 $sock($sockname).mark
.play -n $2 $+(tmpdata,$2)
.remove $+(tmpdata,$2)
}
http://craxxe.sytes.net/irc.asp?get=keyword
as this is an anime related thing you can try any title you wish. example "burn" "chobits" "bebop".
I have also worked with package http and egghttp but i quite dont get it yet, this is the closest to the finished thing ive found -> http://www.tclscript.com/egghttp_tut.shtml
But still, it only types out one line.
One last thing, the way the irc.asp files generates the file can be changed to anything else, as another older version of my mIRC script exchanged "-" signs to simple " " spaces, just the anser to all the "---" signs
(the site isnt up for the moment.)
EDIT
Hrm, i have been looking around some more and now i know for a fact that this script is doable, altho i am a novice at this still, i get confused while reading the code.
So far the script i have found sofar has helped me some (!bash script on this site) but i would still want some hints and tips on how to make this work.