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 

Simple usersearch help needed

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 3:26 pm    Post subject: Simple usersearch help needed Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Jun 03, 2006 3:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 4:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Jun 03, 2006 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 4:14 pm    Post subject: Reply with quote

I tried adding that line, but my drop is still not responding to the trigger.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Jun 03, 2006 4:20 pm    Post subject: Reply with quote

Oops! Embarassed 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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 4:25 pm    Post subject: Reply with quote

Thanks for your quick replies, but maybe im wayy to tired, cause where would I put the []'s ?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Jun 03, 2006 4:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 4:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Jun 03, 2006 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Jun 03, 2006 6:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Jun 04, 2006 1:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sun Jun 04, 2006 4:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Jun 05, 2006 12:10 am    Post subject: Reply with quote

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. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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