mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2018
Posts: 3
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Jul 2018
Posts: 3
on *:TEXT:*:#:{
if (!quake isin $strip($stripstyle($1-))) {
set %q.chan #
quakestart
}
}
alias quakestart {
sockclose canterburyquakelive
msg $chan Collecting Quake Data...
sockopen canterburyquakelive quakelive.co.nz 80
window -ek @quakes
}
on *:sockopen:canterburyquakelive: {
echo @quakes 4 Connected to canterburyquakelive...
sockwrite -n $sockname GET http://quakelive.co.nz/Top100NewZealand30Days HTTP/1.1
sockwrite -n $sockname Host: www.quakelive.co.nz
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)
sockwrite -n $sockname $str($crlf,2)
}
on *:sockread:canterburyquakelive: {
var %r
sockread %r
tokenize 32 %r
echo @quakes %r
if (',' isin $1-) {
set %code $striphtml($1-)
privmsg %q.chan %code
}
}
alias striphtml { return $regsubex($1-,/<.+?>/g,) }
alias stripstyle { return $strip($regsubex($1-, /\[(?:style\x20.*?|/style)\]/gi,$null)) }







this is the info it puts out.

¥2^Admin_TheRavenAge:   Collecting Quake Data... 
                          ¥2^Admin_TheRavenAge:   89400,176.319600,'21 Jul 2018 12:05pm','3.16','171.88','649.88','2 km north-west of Wharepaina, Waikato, New Zealand','III'],[-40.279880,173.995500,'24 Jul 2018 1:51am','3.15','130.62','378.63','In the water 43 km north of Stephens Island, New Zealand','III'],[-45.239800,166.798200,'28 Jun 2018 3:19am','3.14','5.00','501.19','In the water 4 km west-north-west of Nea Island, Southland, 
                          ¥2^Admin_TheRavenAge:   New Zealand','III'],[-42.742300,175.178800,'01 Jul 2018 4:00pm','3.14','33.00','224.14','In the water 121 km east-south-east of Clarence, New Zealand','III'],[-37.285200,177.676800,'16 Jul 2018 1:47pm','3.12','107.82','814.79','In the water 38 km north-west of Otarawhata Island, New Zealand','III'],[-43.260200,172.845800,'22 Jul 2018 7:07am','3.12','30.31','34.57','In the water 11 km 
                          ¥2^Admin_TheRavenAge:   east-north-east of Waikuku Beach, Canterbury, New Zealand','III'],[-39.230600,174.749600,'27 Jun 2018 7:11pm','3.11','184.70','509.64','6 km west-north-west of Aotuhia, Taranaki, New Zealand','III'],[-39.185700,178.607600,'03 Jul 2018 3:11pm','3.11','33.00','693.80','In the water 56 km east of Hawini Rocks, New Zealand','III'],[-38.388200,178.589800,'10 Jul 2018 12:44am','3.10','32. 
                          ¥2^Admin_TheRavenAge:   98','759.16','In the water 21 km east of Pourewa Island, Gisborne, New Zealand','III'],[-42.975300,171.195200,'11 Jul 2018 4:45am','3.10','5.00','132.12','16 km east of South Island, West Coast, New Zealand','III'],[-40.337700,176.589800,'15 Jul 2018 3:10am','3.10','23.29','482.63','5 km south-south-west of Porangahau, Hawke\'s Bay, New Zealand','III'],[-36.266600,177.275800,'10 Jul 
                          ¥2^Admin_TheRavenAge:   2018 7:06am','3.09','283.34','899.17','In the water 126 km east-north-east of Richards Rock, New Zealand','III'],[-46.384100,166.409100,'10 Jul 2018 1:07pm','3.09','25.98','583.46','In the water 34 km south-south-west of Table Rock, New Zealand','III'],[-37.114000,179.112900,'05 Jul 2018 2:21am','3.08','12.00','899.73','In the water 79 km north-east of East Island, New Zealand','III 
 '],[-39.064200,177.771000,'26 Jun 2018 7:14pm','3.07','14.29','656.01','In the water 2 km south-east of Nuhaka, Hawke\'s Bay, New Zealand','III']] ; 


how do i strip it down to remove some the info tags?

thanks inadvanced.

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
maybe it's clear to you but, what do you want to remove from that output exactly?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2018
Posts: 3
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Jul 2018
Posts: 3
Basicly.. from the start of ,'III'], to the start of my info.

Last edited by Timmeh_NZ; 26/07/18 04:45 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Could you be a wee bit more clear? You quote a string that appears 3 times in each message except when truncated by being too long, then you don't make it clear what "my info" is. Can you show what the message is vs what message should be.


Link Copied to Clipboard