I recently saw a Fortune script and I decided to make one of my own. I'm not sure if it works because I haven't really used txt files in my scripts before. I also haven't been able to test it because I am currently not at my house, so I don't have access to mIRC. So pleased don't rant about how horrible this script is, I'll re-write and add to it once I return home. Also, please don't yell at me because I didn't test it.
On 500:text:!createfortune*:#:{
$write(Fortune.txt)
}
On 1:TEXT:!Fortune:#:{
.Timer 1 3 Msg $chan $read(Fortune.txt)
}
}
EL why help someone when they dont even test a code that they post? And when asked, they respond by saying!
Quote:
I would test, got home maybe....I dunno. But I would have to get my bot up and I dun feel like it.
Cause he was on my server and i was bored so i said wtf why not.And its not a completely redone script and he better not just copy it or i wont help again,and i left things to do like th removal of the entries;p.`-.-´
on *:text:*:#:{
if ($nick isop $chan) && ($strip($1) == !createfortune) {
inc -u30 $+(%,_Fortune_F,.,$nick)
if ($($+(%,_Fortune_F,.,$nick),2) == 2) { .notice $nick Please wait;p. | halt }
if ($($+(%,_Fortune_F,.,$nick),2) >= 3) { halt }
if (!$strip($2)) { .notice $nick wtf make soemthing ffs. | halt }
if ($read(Fortune.txt,r,$2-)) { notice $nick $2- already exists | halt }
write Fortune.txt $2-
msg $chan Added: $2-
}
if ($strip($1) == !fortune) {
inc -u30 $+(%,_Fortune_F2,.,$nick)
if ($($+(%,_Fortune_F2,.,$nick),2) == 2) { .notice $nick Please wait;p. | halt }
if ($($+(%,_Fortune_F2,.,$nick),2) >= 3) { halt }
.Timer 1 3 Msg $chan $read(Fortune.txt)
}
}
Your gunan have to make a loop to remove them tho if u want;p
ChunkieMonkey said:
I would test, got home maybe....I dunno. But I would have to get my bot up and I dun feel like it.
well then if you are not going to test what you make dont post it.
just like Jamiie told you:
Jamiie said:
Well if you don't want anyone to rant and raise hell at you for it being a mediocre and not testing then don't post anything.. Common sense man.
anyways you should have made this a socket
on $*:text:/^!Fortune$/iS:#: {
if ($sock(fo)) sockclose fo
sockopen fo www.fortunecookiemessage.com 80
sockmark fo msg #
}
on *:sockopen:fo: {
sockwrite -nt $sockname GET / HTTP/1.1
sockwrite -nt $sockname Host: $+($sock(fo).addr,$str($crlf,2))
}
on *:sockread:fo: {
var %fo | sockread %fo
if ($regex(%fo,/<a href=.+>(.+)<\/a><\/h1>/)) {
$sock(fo).mark $regml(1)
sockclose fo
}
}