This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

script: page.tcl, html 2 channel, using !cmd args as input

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
v
vbirc
Voice
Posts: 2
Joined: Tue Oct 20, 2009 8:40 am

script: page.tcl, html 2 channel, using !cmd args as input

Post by vbirc »

I don't know how to call the thread title, I am sorry for picking an undescriptive title.

Situation: !<cmd> <args> (empty args = help)
#chat
<user1> !cmd beep
(bot recognized beep as args for cmd, loads web site page with: site.com/script/page.php?args=beep)
php script: page.php
<?php
$output = ''; //start empty
if (!empty($_GET['args']))
{ // isnot empty get args
// my php & sql query here giving $phpsqlresult
$output .= 'your args is $_GET['args'] and result is: $phpsqlresult';
}
else
{
// args was empty, show help
$output .= 'do !cmd value, like !cmd beep';
}
echo $output;
?>
ok, so at this point, the bot has the script, listens to !cmd and when provided, goes to site and does whatever it needs to do, the page echo's out something. WHATEVER that is, the whole page has to be spit out back to the channel. Showing back to the user

<bot1> your args is beep and result is: entry beep found in database
(or else, <bot1> do !cmd value, like !cmd beep)

So what I am requesting is a script that listens for pubcmd !cmd with args and proc that goes out to web page using args, and whatever the result is, (there will be no html/body/divs/table or other html tags, just the echo output) spit it back out to the channel.

I tried understanding examples, maybe i just haven't found the right one, and i have tried rewriting existing scripts, but always failed.

I am hoping someone can do this. you can test with: vbirc.com/bot/index.php?do=$args if you want, for security reasons it will only accept beep and sheep (?do=beep).
Post Reply