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 

Help for return raw

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


Joined: 07 Jul 2012
Posts: 26

PostPosted: Wed Jun 19, 2013 9:40 pm    Post subject: Help for return raw Reply with quote

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

[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:

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
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jun 20, 2013 7:58 am    Post subject: Reply with quote

You can use this script for PING http://tclhelp.net/unb/130
You dont need to reinvent the wheel
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Thu Jun 20, 2013 6:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Jun 20, 2013 6:46 pm    Post subject: Reply with quote

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:
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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Thu Jun 20, 2013 8:11 pm    Post subject: Reply with quote

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:
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 ?
Back to top
View user's profile Send private message
caesar
Mint Rubber


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

PostPosted: Fri Jun 21, 2013 12:28 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
gembels
Voice


Joined: 07 Jul 2012
Posts: 26

PostPosted: Fri Jun 21, 2013 1:40 am    Post subject: Reply with quote

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:

-> 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..
Back to top
View user's profile Send private message
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