| View previous topic :: View next topic |
| Author |
Message |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Tue Jun 27, 2006 3:09 pm Post subject: Can anyone tell me where I went wrong ? :( |
|
|
Ok i wrote this..
| Code: |
bind pub * !test2 test2
proc test2 {nick uhost handle chan arg} {
putquick "privmsg #Help :15"
putquick "privmsg #Help :14"
putquick "privmsg #Help :13"
putquick "privmsg #Help :12"
putquick "privmsg #Help :11"
putquick "privmsg #Help :10"
putquick "privmsg #Help :9"
putquick "privmsg #Help :8"
putquick "privmsg #Help :7"
putquick "privmsg #Help :6"
putquick "privmsg #Help :5"
putquick "privmsg #Help :4"
putquick "privmsg #Help :3"
putquick "privmsg #Help :2"
putquick "privmsg #Help :1"
putquick "privmsg #Help :!kicksrc"
putquick "privmsg #Help :Please Connect Now !"
}
utimer 30 {
proc topic_update {sock} {
set headers [egghttp:headers $sock]
set topic [egghttp:data $sock]
regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*)</font></tr>} $topic - dj
putquick "topic #LynxFM :\0030,12 ~ This Is LynxFM -|- The current DJ is: $dj ~ "
#putquick "privmsg operserv :svsnick $djnick $djnick|On-Air"
}
}
|
it does the count down bit fine, but the last bit dont work, i get this from .set errorInfo
ntIRC [14:08] #Nick# set errorInfo
ntIRC Currently: wrong # args: should be "topic_update sock"
ntIRC Currently: while executing
ntIRC Currently: "topic_update "
any ideas please ?
I am trying hehe  _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Tue Jun 27, 2006 4:19 pm Post subject: |
|
|
you shouldn't declare the proc inside the utimer, you should just call it then
| Code: | proc topic_update {sock} {
set headers [egghttp:headers $sock]
set topic [egghttp:data $sock]
regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*)</font></tr>} $topic - dj
putquick "topic #LynxFM :\0030,12 ~ This Is LynxFM -|- The current DJ is: $dj ~ "
#putquick "privmsg operserv :svsnick $djnick $djnick|On-Air"
}
utimer 30 topic_update <your arg here> |
|
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Tue Jun 27, 2006 5:29 pm Post subject: .. |
|
|
will that make it call the second proc 30 seconds after it completes the first tho ?  _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Tue Jun 27, 2006 5:40 pm Post subject: |
|
|
| no.. if you want it to get called 30 seconds after it finishes, paste the utimer 30 line after the last line in proc test2 |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 5:42 am Post subject: ... |
|
|
Dude that dont work.. i get this from .set errorInfo..
ntIRC Currently: wrong # args: should be "utimer seconds command"
ntIRC Currently: while executing
ntIRC Currently: "utimer 30"
ntIRC Currently: (procedure "test2" line 20)
ntIRC Currently: invoked from within
ntIRC Currently: "test2 $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Im lost lol _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Wed Jun 28, 2006 6:15 am Post subject: |
|
|
| he said the utimer 30 line, not just utimer 30. |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 6:59 am Post subject: right... |
|
|
When I add it like
| Code: |
utimer 10 topic_update {sock}
|
I get..
Tcl error [test2]: wrong # args: should be "utimer seconds command"
So i remove the arg {sock} then i get this..
Tcl error in script for 'timer8':
wrong # args: should be "topic_update sock"
Im very confused as to what i need to do now  _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Wed Jun 28, 2006 7:01 am Post subject: |
|
|
| Code: | | utimer 10 [list topic_update $sock] |
|
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 7:15 am Post subject: ... |
|
|
Ok that 'seems' to have fixed that, but now I get the error..
Tcl error in script for 'timer9':
can't read "dj": no such variable
But dj is clearly there lol, here's the whole script now..
| Code: | bind pub * !test2 test2
proc test2 {nick uhost handle chan arg} {
putquick "privmsg #Help :5"
putquick "privmsg #Help :4"
putquick "privmsg #Help :3"
putquick "privmsg #Help :2"
putquick "privmsg #Help :1"
putquick "privmsg #Help :!kicksrc"
putquick "privmsg #Help :Please Connect Now !"
utimer 10 [list topic_update sock]
}
proc topic_update {sock} {
set headers [egghttp:headers $sock]
set topic [egghttp:data $sock]
#set topic1 [egghttp:data $sock]
regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*)</font></tr>} $topic dj
#regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*)-} $topic1 - djnick
putquick "topic #LynxFM :\0030,12 ~ This Is LynxFM -|- The current DJ is: $dj ~ "
#putquick "privmsg operserv :svsnick $djnick $djnick|On-Air"
} |
Any ideas ?
Sorry if i'm being thick  _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 1:24 pm Post subject: ... |
|
|
anyone ? :-/ _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Jun 28, 2006 1:42 pm Post subject: |
|
|
you are missing the extra argument in the first regexp, add something like - or "" or {} before 'dj'. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 2:20 pm Post subject: ... |
|
|
That was there, just missed it when putting it in the forum sorry
I tried using the others you said but didnt' work _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Jun 28, 2006 2:23 pm Post subject: |
|
|
the regexp simply does not match, check the syntax against the source. There are even tools out there to test regular expression, if you are not familar enough with them to match them with your brain . _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Wed Jun 28, 2006 3:19 pm Post subject: ... |
|
|
Someone slap me lol, i hadnt set url or anything
derrrrrr
Anyway, the script now looks like this..
| Code: | bind pub * !test2 test2
proc test2 {nick uhost handle chan arg} {
putquick "privmsg #Help :5"
putquick "privmsg #Help :4"
putquick "privmsg #Help :3"
putquick "privmsg #Help :2"
putquick "privmsg #Help :1"
putquick "privmsg #Help :!kicksrc"
putquick "privmsg #Help :Please Connect Now !"
utimer 10 [list topic_update sock]
}
set url "http://www.lynxfm.info/stream.html"
proc topic_update {sock} {
global url
set headers [egghttp:headers $sock]
set topic [egghttp:data $sock]
set topic1 [egghttp:data $sock]
set sock [egghttp:geturl $url topic_update]
return 1
regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*)</font></tr>} $topic "" dj
regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*) - .*</font></tr>} $topic1 - djnick
putquick "topic #LynxFM :\0030,12 ~ This Is LynxFM -|- The current DJ is: $dj ~ "
putquick "privmsg operserv :svsnick $djnick $djnick|On-Air"
}
|
and now gives the error..
ntIRC Currently: can't read "egghttp(9,body)": no such element in array
ntIRC Currently: while executing
ntIRC Currently: "if {![string match "*<*" $input] && ($egghttp($sock,body) == "")} {
ntIRC Currently: append egghttp($sock,headers) "$input\n"
ntIRC Currently: if {[string match "*HTTP/*" $inpu..."
ntIRC Currently: (procedure "egghttp:control" line 1
ntIRC Currently: invoked from within
ntIRC Currently: "egghttp:control $_n $_a"
Anyone have any idea what that means ??
 _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Jun 29, 2006 2:23 am Post subject: |
|
|
This script makes absolutely no sense at all.
It looks like you have no idea what you're doing if i read this.
I would advise you to use the http module anyway, i've found it to be much easier and better then egghttp.
Hint: You might want to try to call the topic_update with an actual socket, right now your script just loops by getting the website over and over (if i read it right) |
|
| Back to top |
|
 |
|