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.

raw on connect

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
a
albozz
Voice
Posts: 8
Joined: Tue Jul 12, 2016 1:40 pm
Location: Albania
Contact:

raw on connect

Post by albozz »

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
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

first you need to determine where you can get that information from and then have eggdrop retreive it and send it
a
albozz
Voice
Posts: 8
Joined: Tue Jul 12, 2016 1:40 pm
Location: Albania
Contact:

Post by albozz »

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]
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

Code: Select all

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
a
albozz
Voice
Posts: 8
Joined: Tue Jul 12, 2016 1:40 pm
Location: Albania
Contact:

Post by albozz »

Thx for help but how to remove this:
[08:17] <Rocky> Nick: *** Client connecting: tunix10 - IP: 85.25.10.40 - Country: France - City: Strasbourg - ISP: Host Europe GmbH
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

Image

You could change :

Code: Select all

\002Nick\002: $nick 
to

Code: Select all

\002Nick\002: [regsub -all {([^:]+:)} $nick ""]
Life iS Just a dReaM oN tHE wAy to DeaTh
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I've exactly the same thing than heartbroken:

Code: Select all

% 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 ?
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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? :lol:
ComputerTech
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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 ?
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Their API isn't working properly for some reason as i get this JSON answer:
{"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.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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. :?

Cheers lads :wink:
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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 !
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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

Cheers CrazyCat
ComputerTech
Post Reply