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.

Help for return raw

Help for those learning Tcl or writing their own scripts.
Post Reply
g
gembels
Voice
Posts: 26
Joined: Sat Jul 07, 2012 9:31 pm

Help for return raw

Post by gembels »

This what I got from mirc if I did /raw p gembels

Code: Select all

[11:35] -server1- Hi, Your latency check for gembels is 2 ms.
-
[11:35] -server1- Server: server1
-
[11:35] -server1- Thu, 20 June 2013 08:35:39
-
[11:35] -server1- Modded by gembels
How to do like

Code: Select all

bind pub - !ping ping_me

proc ping_me {nick uhost hand chan arg} {
putquick "PRIVMSG $chan :$arg ping $result"
}
How to grep the "2 ms" in eggdrop and do the "raw p" command

and how to set the $result ?


Thanks
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

You can use this script for PING http://tclhelp.net/unb/130
You dont need to reinvent the wheel
g
gembels
Voice
Posts: 26
Joined: Sat Jul 07, 2012 9:31 pm

Post by gembels »

Madalin wrote:You can use this script for PING http://tclhelp.net/unb/130
You dont need to reinvent the wheel
thanks Madalin, but this IRCD are bit different, there is no ctcr, the IRCD commands are bit different. To get a ping, the reply was not /ping $nick but /raw p $nick
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

The /raw command in mIRC is merely used to send a string directly to the server without parsing; in eggdrops you use the puthelp, putserv, or putquick commands. So in your case, that part of the code would be something like this

Code: Select all

bind pub - !ping ping_me
proc ping_me {nick host handle channel text} {
  puthelp "P $nick"
}
You would still have to parse the response from the irc server, which is done using a binding. Exactly how to do this depends on what kind of message/command your irc server uses to send the response. If it is a server-notice, you're pretty much stuck with the RAW binding, which can be somewhat dangerous if you don't know what you are doing...
NML_375
g
gembels
Voice
Posts: 26
Joined: Sat Jul 07, 2012 9:31 pm

Post by gembels »

nml375 wrote:The /raw command in mIRC is merely used to send a string directly to the server without parsing; in eggdrops you use the puthelp, putserv, or putquick commands. So in your case, that part of the code would be something like this

Code: Select all

bind pub - !ping ping_me
proc ping_me {nick host handle channel text} {
  puthelp "P $nick"
}
You would still have to parse the response from the irc server, which is done using a binding. Exactly how to do this depends on what kind of message/command your irc server uses to send the response. If it is a server-notice, you're pretty much stuck with the RAW binding, which can be somewhat dangerous if you don't know what you are doing...
how to get var from puthelp "P $nick" ?

set result "puthelp "P $nick""
regxp ... $result
then I got the 2ms ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You need to catch the RAW response if you want that result. In mIRC do /debug @test then do that /raw p gembels and copy/paste what you see in the @test window.
Once the game is over, the king and the pawn go back in the same box.
g
gembels
Voice
Posts: 26
Joined: Sat Jul 07, 2012 9:31 pm

Post by gembels »

caesar wrote:You need to catch the RAW response if you want that result. In mIRC do /debug @test then do that /raw p gembels and copy/paste what you see in the @test window.

Code: Select all

-> server1 p gembels
<- :server1  NOTICE dono :Hi, Your latency check for gembels is 37 ms.
<- :server1  NOTICE dono :Server: server1
<- :server1  NOTICE dono :Fri, 21 June 2013 12:38:09
<- :server1  NOTICE dono :Modded by gembels
dono is my nick
gembels is the person I ping..
Post Reply