RMX-OS eggdropbot script

Started by edwardthefma, January 15, 2010, 12:30:23 pm

Previous topic - Next topic

edwardthefma

January 15, 2010, 12:30:23 pm Last Edit: January 15, 2010, 01:35:27 pm by Blizzard
RMX-OSeggdropbot
Authors: Pixelz
Type: eggdropbot script



Introduction
a irc bot for rmx-os  that displayes your user information



Features


  • a irc bot for rmx-os




Screenshots
N/A
Demo

N/A


Script

Make a new file with an .tcl extension in the scripts folder ofyoueggdrop bot and copy-paste this script into it.
Spoiler: ShowHide
# online-users.tcl --
#
#     This script fetches online users and displays them in +online-users channels.
#
# The author disclaims copyright to this source code.
#
# v1.0 by Pixelz (rutgren@gmail.com), January 15, 2010

package require eggdrop 1.6
package require Tcl 8.4
package require http

namespace eval ::online-users {
setudef flag {online-users}
variable url {http://ssh.shellium.org/~shmmo/online.php}
}

proc ::online-users::pub_online {nick uhost hand chan arg} {
variable url
if {![channel get $chan {online-users}]} { return }
if {[catch {set tok [::http::geturl $url]} error]} {
putlog "online-users.tcl geturl error: $error"
return
} elseif {[::http::status $tok] ne {ok}} {
putlog "online-users.tcl status error: [::http::error $tok]"
::http::cleanup $tok
return
} elseif {[::http::ncode $tok] != 200} {
putlog "online-users.tcl http error: [::http::code $tok]"
::http::cleanup $tok
return
} else {
set data [::http::data $tok]
::http::cleanup $tok
if {[regexp -nocase -- {Users currently online: (\d+) / (\d+)} $data - online total] != 1} { putlog "online-users.tcl error in regular expression"; return }
putserv "PRIVMSG $chan :Users currently online: $online / $total"
}
return
}

namespace eval ::online-users {
bind pub - "!online" ::online-users::pub_online
putlog "Loaded online-users.tcl v1.0 by Pixelz"
}






then make a .php file and put this script in it and upload it to the web
Spoiler: ShowHide
<html>
<body>
<?php readfile// (comment out)("/home/e/edwardthefma/RMX-OS Server/logs/users.log"); ?>

<?php $data = file('/home/e/edwardthefma/RMX-OS Server/logs/users.log');
echo end($data);
?>
</body>
</html>

then change ("/home/e/edwardthefma/RMX-OS Server/logs/users.log") to the location of your log file


Instructions
ok you will need to find variable url {http://ssh.shellium.org/~shmmo/online.php}
inthe script and chang it to the url of your php file
also you will need to /ctcp botname chat
then after you are logged on to your bot
.chanset #channelname +online-users
if you have never used a egg drop bot it would be smart
to read up first @ http://www.egghelp.org and http://wiki.shellium.org/w/Eggdrop


Compatibility
need rmx-os userlogger to work


Credits and Thanks

    Pixelz




Author's Notes
dont ask  about how to set up a egg bot
:)just read up on then and learn somthing

That's it! N-Joy! =D
i am the lead dev for the shellium mmorpg project
http://wiki.shellium.org/w/Mmorpg
shellium.org :) free linux shells pm me and i will gladly
help you get 1