egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pre.tcl auto spamm :)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
siriow
Voice


Joined: 11 Dec 2008
Posts: 1

PostPosted: Thu Dec 11, 2008 8:06 am    Post subject: Pre.tcl auto spamm :) Reply with quote

hello, I would want to make so that my script pre.tcl spam news in IRC chan every 10 minutes. Unfortunately it does not make it, I I have tried various ways but I do not succeed to resolve it, if someone can help me, thanks in advance.

Davide Torino Italy.

This is the code:

### BINDS ###

#bind time - "00 * * * *" dlx:pretimes:scnsrc2
#bind time - "15 * * * *" dlx:pretimes:scnsrc2
#bind time - "30 * * * *" dlx:pretimes:scnsrc2
#bind time - "45 * * * *" dlx:pretimes:scnsrc2
bind pub - !pre dlx:pretimes:scnsrc
bind pub - !pred dlx:pretimes:scnsrc2

if {![info exists dlx:pretimes:scnsrc2_running]} {
timer 10 dlx:pretimes:scnsrc2
set dlx:pretimes:scnsrc2_running 1
}

# SCRIPT START

proc dlx:pretimes:scnsrc { nick host hand chan arg } {
global pre
set got_custom_number [regexp {\-n=([0-9]+)} $arg gothit custom_number]
if {$got_custom_number} { set arg [lrange $arg 1 end] }
set arg [string map { " " "%" } $arg]
set arg [string map { "*" "%" } $arg]
set urlEncodeArg [http::formatQuery search $arg]
if {([lsearch -exact $pre(availchans) $chan] == -1) && ($chan != "privmsg")} {return}
if {([lsearch -exact $pre(quietchans) $chan] != -1) || ($chan == "privmsg")} {set chan $nick}
if {$got_custom_number} {
set url "http://scnsrc.net/pre/bots.php?user=$pre(username)&pass=$pre(password)&$urlEncodeArg&results=$custom_number"
} else {
set url "http://scnsrc.net/pre/bots.php?user=$pre(username)&pass=$pre(password)&$urlEncodeArg"
}

set page [http::data [http::geturl $url]]
if { $arg == "" } {
putquick "PRIVMSG $chan :Usage: !pre \[-n=number\]<keywords or releasename>"
} else {
if { $page == "Stay out." } {
putquick "PRIVMSG $chan :PREDB: Your account got revoked. Tough luck fool! This script is now useless!"
} else {
if { $page == "" } { putquick "PRIVMSG $chan :$pre(prefix) Got 0 hits to your query." } else {
foreach release [split $page "\n"] {
if { [string first "^" $release] != -1 } {
set item [split $release "^"]
set releasename [lindex $item 1]
set section [lindex $item 2]
set time [lindex $item 0]
set nuked [lindex $item 3]
set reason [lindex $item 4]
if { $nuked == "" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section $arg"
} elseif { $nuked == "nuked" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section. \0034 It was NUKED: $reason \003"
} elseif { $nuked == "unnuked" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section. \0033 It was UNNUKED: $reason \003"
}
}
}
}
}
}
}


proc dlx:pretimes:scnsrc2 { nick host hand chan arg } {
global pre
set got_custom_number [regexp {\-n=([0-9]+)} $arg gothit custom_number]
if {$got_custom_number} { set arg [lrange $arg 1 end] }
set arg [string map { " " "%" } $arg]
set arg [string map { "*" "%" } $arg]
set ast *
set arg ast
puts [set $arg]
set urlEncodeArg [http::formatQuery search $arg]
if {([lsearch -exact $pre(availchans) $chan] == -1) && ($chan != "privmsg")} {return}
if {([lsearch -exact $pre(quietchans) $chan] != -1) || ($chan == "privmsg")} {set chan $nick}
if {$got_custom_number} {
set url "http://scnsrc.net/pre/bots.php?user=$pre(username)&pass=$pre(password)&$urlEncodeArg&results=$custom_number"
} else {
set url "http://scnsrc.net/pre/bots.php?user=$pre(username)&pass=$pre(password)&$urlEncodeArg"
}

set page [http::data [http::geturl $url]]
if { $arg == "" } {
putquick "PRIVMSG $chan :Usage: !pre \[-n=number\]<keywords or releasename>"
} else {
if { $page == "Stay out." } {
putquick "PRIVMSG $chan :PREDB: Your account got revoked. Tough luck fool! This script is now useless!"
} else {
if { $page == "" } { putquick "PRIVMSG $chan :$pre(prefix) Got 0 hits to your query." } else {
foreach release [split $page "\n"] {
if { [string first "^" $release] != -1 } {
set item [split $release "^"]
set releasename [lindex $item 1]
set section [lindex $item 2]
set time [lindex $item 0]
set nuked [lindex $item 3]
set reason [lindex $item 4]
if { $nuked == "" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section $arg"
} elseif { $nuked == "nuked" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section. \0034 It was NUKED: $reason \003"
} elseif { $nuked == "unnuked" } {
putquick "PRIVMSG $chan :\002 $pre(prefix) \002 $releasename was released $time ago in $section. \0033 It was UNNUKED: $reason \003"
}
}
}
}
}
}
timer 10 dlx:pretimes:scnsrc2
return 1
}




# UPDATE CHECK

set url "http://www.scnsrc.net/pre/script_version.nfo"
set page [http::data [http::geturl $url]]
regexp {Latest@([0-9\.a-z]+)} $page gotlatest latest
regexp {URI@(.*)} $page goturi uri
regexp {Changelog@(.*)} $page gotlog changelog
if {$latest > $scnsrc_pre_version} {
putlog "scnsrc-pre New version out: v$latest (you have v$scnsrc_pre_version)"
putlog "scnsrc-pre Get it while its hot: $uri"
putlog "scnsrc-pre Changelog: $changelog"
} else {
putlog "scnsrc-pre loaded.. you just got pwned by dlx. and youre up to date (v$scnsrc_pre_version)"
}

# Change the putlog message and the world will end
Back to top
View user's profile Send private message
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Thu Dec 11, 2008 8:45 am    Post subject: Reply with quote

contact authors
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber