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 

CTCP VERSION

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ORATEGOD
Voice


Joined: 08 Jun 2020
Posts: 22

PostPosted: Mon Jul 12, 2021 7:40 pm    Post subject: CTCP VERSION Reply with quote

Greetings Guys entering a server a few days ago and I found this message from an eggdrop.

The question is can this TCL be replicated?

[19:25] <Data> Your IRC Client is susceptible to hacks! Upgrade or get a new client. See https://www.exploit-db.com/exploits/46392 Upgrade to 7.55+ @ www.mirc.com or !Search mirc in #Chat



THANK YOU IN ADVANCE FOR YOUR RESPONSES
Back to top
View user's profile Send private message AIM Address
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 848
Location: France

PostPosted: Tue Jul 13, 2021 2:53 am    Post subject: Reply with quote

Yes it can. The difficulty is to determine how to set versions and check them.

I think it's possible with a kind of dataset containing clients, minimal version and message to send.
I'll try to look about that in the day.
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 848
Location: France

PostPosted: Tue Jul 13, 2021 6:24 am    Post subject: Reply with quote

Few hours after Smile

Here is a short code, it actually works on join channel, I let you adapt the way you want to have it working.

Code:
namespace eval vwarn {

   dict set minver mirc {min 7.55 msg "Please update to mIRC 7.55" }
   dict set minver weechat {min 3.1 msg "New version 4.0 is better"}

   bind join - * ::vwarn::join
   proc join {nick uhost handle chan} {
      if {[isbotnick $nick]} { return 0 }
      putserv "PRIVMSG $nick :\001VERSION\001"
   }

   bind ctcr - VERSION ::vwarn::check
   proc check {nick uhost handle dest kw arg} {
      foreach soft [dict keys $::vwarn::minver] {
         if {[string match "*${soft}*" [string tolower $arg]]} {
            regexp {(\d{1,}\.?\d{1,})} $arg - vnum
            if {[package vcompare $vnum [dict get $::vwarn::minver $soft min]]==-1} {
               putserv "PRIVMSG $nick :[dict get $::vwarn::minver $soft msg]"
            }
         }
      }
   }
}


The important thing is the lines begining with dict set minver, which allows you to add client (in my case mirc and weechat), the minimal version (7.55 and 3.1) and the associated message.
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.


Last edited by CrazyCat on Wed Jul 14, 2021 3:40 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ORATEGOD
Voice


Joined: 08 Jun 2020
Posts: 22

PostPosted: Tue Jul 13, 2021 8:53 pm    Post subject: Reply with quote

works 100% ... as always I appreciate all the help they offer to all users.

(excuse my bad English)
Back to top
View user's profile Send private message AIM Address
caesar
Mint Rubber


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

PostPosted: Wed Jul 14, 2021 3:03 am    Post subject: Reply with quote

Please change:
Code:

if {[string tolower $nick] eq [string tolower $::botnick]} { return 0 }

to:
Code:

if {[isbotnick $nick]} return

cos bothers my OCD. Laughing
_________________
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
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 848
Location: France

PostPosted: Wed Jul 14, 2021 3:42 am    Post subject: Reply with quote

Can't see what you're talking about Laughing (thanks edit Very Happy)

I must stop paste&copy starts of my proc from really old scripts I made Smile
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
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 -> Script Requests 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