| View previous topic :: View next topic |
| Author |
Message |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 3:26 pm Post subject: Simple usersearch help needed |
|
|
I've got this little script:
| Code: |
bind pub - !user foo
proc foo {n u h c a} {
set nick [lindex [split $a] 0]
if {$nick!=""} {
set data [::http::geturl http://www.mysite.com/users.php?search=]
foreach line [split [::http::data $data] \n] {
putserv "PRIVMSG $c :$line"
}
::http::cleanup $data
}
}
|
Wich will then post a link to the users profile page from the site.
But somehow it is not working, am I missing something? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jun 03, 2006 3:51 pm Post subject: |
|
|
| Code: |
bind pub - !user foo
proc foo {n u h c a} {
if {![llength [set nick [lindex [split $a] 0]]]} return
set token [::http::geturl http://www.mysite.com/users.php?search=$nick]
set data [::http::data $token]
::http::cleanup $data
foreach line [split $data \n] {
putserv "PRIVMSG $c :$line"
}
}
|
Shouldn't the url be "http://www.mysite.com/users.php?search=nick" by any chance?
Edit: Damn typos. Fixed it.. again. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Sat Jun 03, 2006 4:52 pm; edited 4 times in total |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 4:00 pm Post subject: |
|
|
| Well, I used that url in a small script for my mIRC bot, wich worked, but this one aint working for my eggdrop and I really would like it to work for my drop, nothing is happening when I type !user starpossen and I tried adding nick to the url, but that didnt help. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jun 03, 2006 4:09 pm Post subject: |
|
|
Then add a line like:
| Code: |
putserv :PRIVMSG $c :finished"
|
or a putlog line to see if the script works. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 4:14 pm Post subject: |
|
|
| I tried adding that line, but my drop is still not responding to the trigger. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jun 03, 2006 4:20 pm Post subject: |
|
|
Oops! Forgot to add a pair of [] to the proc I've posted. Get it again and see if it works.. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 4:25 pm Post subject: |
|
|
| Thanks for your quick replies, but maybe im wayy to tired, cause where would I put the []'s ? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jun 03, 2006 4:28 pm Post subject: |
|
|
Not you, I forgot to add them in the proc I've posted above. Get it again and test it on your bot. Also, change that url to "http://www.mysite.com/users.php?search=$nick" because this way I think it should be. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 4:37 pm Post subject: |
|
|
This is what happens:
| Code: |
[22:36:15] <%starbot> ::http::17
|
And the number gets higher every time I trigger the command. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Jun 03, 2006 4:55 pm Post subject: |
|
|
Silly me... It's a bit late and I must be blind or something.. I have fixed the code .. again.. sorry.
| Code: |
bind pub - !user foo
proc foo {n u h c a} {
if {![llength [set nick [lindex [split $a] 0]]]} return
set token [::http::geturl http://www.mysite.com/users.php?search=$nick]
set data [::http::data $token]
::http::cleanup $data
foreach line [split $data \n] {
putserv "PRIVMSG $c :$line"
}
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Jun 03, 2006 6:03 pm Post subject: |
|
|
Still wont react, I made one for my mIRC bot:
| Code: |
on *:text:.user*:#:{
if ($nick isop $chan && $2-) { /user $nick $2- }
}
alias user {
if ($1 && $2-) {
notice $1 http://www.mysite.com/users.php?search= $+ $replace($2-,$chr(32),+)
}
}
|
Wich will post the link to the username in the searchlist on the site.
I dont know if this can be rewritten to tcl., if the other one cant be fixed? |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jun 04, 2006 1:54 am Post subject: |
|
|
| starpossen wrote: |
I dont know if this can be rewritten to tcl., if the other one cant be fixed? |
you are on the wrong forum dude, this one is for people who know at least the basics of Tcl, and obviously you aren't among them
post to "Script Requests" _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sun Jun 04, 2006 4:29 am Post subject: |
|
|
| Im very well aware of what forum this is, I just asked a question, and showed the mirc script as an example, and hoping it might shed a light on my idea, but nevermind. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Jun 05, 2006 12:10 am Post subject: |
|
|
No point posting a mIRC 'script' on a forum exclusively for Tcl. You'd be lucky if anyone could understand it anyway. Learn Tcl and attempt a translation yourself maybe.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|