| View previous topic :: View next topic |
| Author |
Message |
desired Voice
Joined: 12 Sep 2011 Posts: 31
|
Posted: Sat Dec 10, 2011 1:48 pm Post subject: utimers returns nothing? |
|
|
utimers when called with .tcl partyline it shows a list with all utimers.
But when I call utimers from another proc which gets invoked by a bind it returns always nothing. Even when there are still utimers (which I see, I tested to type .tcl utimers on partyline again).
Why is that?
I also testet set utimers [uplevel #0 { utimers }], still didn't work.
How can I get them? _________________ eggdrop running on Android powered mobile phone - Yes, it is possible! - Very reliable. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Dec 10, 2011 2:37 pm Post subject: Re: utimers returns nothing? |
|
|
| Can you post your script so we can see it? |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Dec 10, 2011 2:39 pm Post subject: Re: utimers returns nothing? |
|
|
| desired wrote: |
...
I also testet set utimers [uplevel #0 { utimers }], still didn't work.
...
|
Have you tried it with square brackets?
i.e. [utimers] |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Dec 10, 2011 4:27 pm Post subject: |
|
|
desired,
this sounds like a bug to me. However, I am not able to reproduce it myself. What kind of binding did you use?
As for uplevel, the context of where utimers is invoked should not matter, as timers are always stored and accessed on a global scope.
willyw,
For that piece of code to work as expected, one should NOT use square brackets. The idea is for the code block to be evaluated at a different context than the current - which is why we do not want any command substitutions done in the current context. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Dec 10, 2011 8:58 pm Post subject: |
|
|
| nml375 wrote: |
...
For that piece of code to work as expected, one should NOT use square brackets.
...
|
Ok. |
|
| Back to top |
|
 |
desired Voice
Joined: 12 Sep 2011 Posts: 31
|
Posted: Thu Dec 15, 2011 3:33 am Post subject: |
|
|
Thanks for all your help.
Ok, I was able to reproduce it. Here is a script which I wrote to show you the error. It has been tested and hopefully I did not mess up and you can reproduce it.
| Code: | proc isutimer_ { id } {
foreach utimer [utimers] {
set isid [lindex $utimer 2]
if { $id == $isid } {
return 1
}
}
return 0
}
bind dcc nm|- test test_dcc
proc test_dcc { args } {
putlog "test_dcc::: utimers: [utimers]"
putlog "test_dcc::: isutimer $::re_utimer: [isutimer_ $::re_utimer]"
utimer 1 [list test_dcc_show]
}
proc test_dcc_show { } {
putlog "test_dcc_show::: utimers: [utimers]"
putlog "test_dcc_show::: isutimer $::re_utimer: [isutimer_ $::re_utimer]"
}
proc test_re { } {
putlog "test_re ..."
set ::re_utimer [utimer 10 [list test_re]]
}
if { ! [info exists ::re_started] } {
set ::re_started 1
test_re
} |
Results:
test_dcc will show everything correctly but test_dcc_how will not know anything about utimers anymore... _________________ eggdrop running on Android powered mobile phone - Yes, it is possible! - Very reliable. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Dec 16, 2011 4:24 pm Post subject: |
|
|
Unfortunately, that code will not cause the described behavior on a 1.6.21 eggdrop I just tested it on. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
desired Voice
Joined: 12 Sep 2011 Posts: 31
|
Posted: Sat Dec 17, 2011 4:33 am Post subject: |
|
|
EDIT:
I am on 1.8. _________________ eggdrop running on Android powered mobile phone - Yes, it is possible! - Very reliable.
Last edited by desired on Sat Dec 17, 2011 10:20 pm; edited 1 time in total |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Dec 17, 2011 1:37 pm Post subject: |
|
|
| desired wrote: | | I am on 1.9. |
Really??!
Did you miss the memo??!
1.9 is dead. Has a fork sticking out of it. Why are you using it?
Try 1.6.21 or 1.8 .. These at least are still in development.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
desired Voice
Joined: 12 Sep 2011 Posts: 31
|
|
| Back to top |
|
 |
|