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 

raw on connect
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
albozz
Voice


Joined: 12 Jul 2016
Posts: 8
Location: Albania

PostPosted: Sun Aug 30, 2020 1:31 pm    Post subject: raw on connect Reply with quote

hello anyone help me, i want this exp:

Nick:User-nick - IP: 172.58.206.164 - Country: United States - City:Philadelphia - ISP: T-Mobile USA
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sun Aug 30, 2020 2:11 pm    Post subject: Reply with quote

first you need to determine where you can get that information from and then have eggdrop retreive it and send it
Back to top
View user's profile Send private message
albozz
Voice


Joined: 12 Jul 2016
Posts: 8
Location: Albania

PostPosted: Sun Aug 30, 2020 4:03 pm    Post subject: Reply with quote

send raw connect on user's on unrealircd on exp #opers chan who connect , nick Ip country state
example

*** Client connecting: astrit (Flash@178.132.216.199) [178.132.216.199] {0} [secure]
Back to top
View user's profile Send private message Visit poster's website
heartbroken
Op


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Sun Aug 30, 2020 4:50 pm    Post subject: Reply with quote

Code:
package require http
package require json

set ExpChan "#opers"

bind raw - NOTICE Client_Connect

proc Client_Connect {from key arg} {
   if {[string match *!*@* $from] || ![string match -nocase "*client connecting*" $arg]} { return }
   if {[scan $arg %\[^\:\]\:%\[^(\](%\[^@\]@%\[^\)\] _ nick ident host] == "4"} {
      set token [http::geturl http://ip-api.com/json/$host?fields=status,city,isp,country,query,regionName,countryCode]
      set data [json::json2dict [http::data $token]]
      ::http::cleanup $token
      if {[dict get $data status] eq "success"} {
         puthelp "PRIVMSG $::ExpChan :\002Nick\002: $nick - \002IP\002: [dict get $data query] - \002Country\002: [dict get $data country] -\
            \002City\002: [dict get $data city] - \002ISP\002: [dict get $data isp] [dict get $data countryCode]"
      } else {
         putcmdlog "Error! it fails to get data for this $host"
      }
   }
   return 0
}

_________________
Life iS Just a dReaM oN tHE wAy to DeaTh
Back to top
View user's profile Send private message
albozz
Voice


Joined: 12 Jul 2016
Posts: 8
Location: Albania

PostPosted: Mon Aug 31, 2020 2:21 am    Post subject: Reply with quote

Thx for help but how to remove this:
Quote:

[08:17] <Rocky> Nick: *** Client connecting: tunix10 - IP: 85.25.10.40 - Country: France - City: Strasbourg - ISP: Host Europe GmbH
Back to top
View user's profile Send private message Visit poster's website
heartbroken
Op


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Mon Aug 31, 2020 4:32 am    Post subject: Reply with quote



You could change :

Code:
\002Nick\002: $nick

to
Code:
\002Nick\002: [regsub -all {([^:]+:)} $nick ""]

_________________
Life iS Just a dReaM oN tHE wAy to DeaTh
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Mon Aug 31, 2020 11:59 am    Post subject: Reply with quote

I've exactly the same thing than heartbroken:
Code:
% set arg {*** Client connecting: astrit (Flash@178.132.216.199) [178.132.216.199] {0} [secure]}
*** Client connecting: astrit (Flash@178.132.216.199) [178.132.216.199] {0} [secure]
% scan $arg %\[^\:\]\:%\[^(\](%\[^@\]@%\[^\)\] _ nick ident host
4
% puts "nick: $nick - ident: $ident - host: $host"
nick:  astrit  - ident: Flash - host: 178.132.216.199
% info patchlevel
8.6.9

@albozz: which version of tcl are you using ?
_________________
https://www.eggdrop.fr - French IRC network
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
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Thu Sep 17, 2020 6:33 pm    Post subject: Reply with quote

This script stopped working all of a sudden, json/http is loaded, and so is the script, and it just stopped working all of a sudden, anyone got a idea why? Laughing
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Thu Sep 17, 2020 7:14 pm    Post subject: Reply with quote

Add putlog after sensible lines to see where it stops.
And first thing to check: is your eggdrop alway logged as ircop with the good snomask, does it see the connect notices ?
_________________
https://www.eggdrop.fr - French IRC network
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
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Thu Sep 17, 2020 7:57 pm    Post subject: Reply with quote

via partyline yeah, when a user connects, i see the ip, and general

and yes bot is currently ircop, and has the correct snomasks

Thing is, it worked perfect a few days ago, and i have Not touched the script.

Does it work for you CrazyCat?
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


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

PostPosted: Fri Sep 18, 2020 12:55 am    Post subject: Reply with quote

Their API isn't working properly for some reason as i get this JSON answer:
Quote:

{"status":"fail","message":"SSL unavailable for this endpoint, order a key at https://members.ip-api.com/"}

So, you got two options:
1. contact them and ask why the free plan isn't working any more and give them the error above
2. get a PRO plan OR switch to another site

Out of curiosity, how many requests did you do on their website per minute? Give me an appreciation, don't need the exact number. I'm asking cos their TOS says you can do 45 per minute else will get yourself banned for an hour or something.
_________________
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
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Sep 18, 2020 8:47 am    Post subject: Reply with quote

Oh, well my network is 300+ users, but i dont believe their would have been 45 connections in 60sec, i mean it's possible, like a netsplit or something,
but i highly doubt it.

I'll go for option one caesar, and contact them, hopefully they can fix it, i will also post here when/if i get it fixed, or if/they contact me back with info. Confused

Cheers lads Wink
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Sep 18, 2020 11:55 am    Post subject: Reply with quote

Ok, so they responded with this via email.

Hello,

As the error message states, you're trying to access the API via https, which has never been supported. Please switch to http.


Kind regards,
vlad
--
ip-api.com

what do we edit on the code then?

does the bot have to access the server via non ssl or something?
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Fri Sep 18, 2020 1:22 pm    Post subject: Reply with quote

If you use the code given by heartbroken, it doesn't use https, so it must work.
And no matter if your eggdrop connects through ssl or not to your server, the http request is independant and will do what you ask it to do (so, connect to http://ip-api.com).

If you didn't change the code and it stopped working, the trouble could be somewhere else. So... putlog !
_________________
https://www.eggdrop.fr - French IRC network
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
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Sep 18, 2020 2:50 pm    Post subject: Reply with quote

Ok, but didnt caesar use heartbroken's clde as well? and got a error

but i will do that and find out whats wrong, then post here Smile

Cheers CrazyCat
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail 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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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