Page 3 of 20

Re: new features/functions in 1.2.0-pre8

Posted: Tue Dec 28, 2010 11:54 pm
by Heiko
Here's a working speed walk package for ire games as some of the old ones may not work with this release.
http://pastebin.com/g4A6T5NF

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 5:11 pm
by Rakon
I believe there is a bug with killTimer or something related to the registering of tempTimers.

If I have a trigger that creates a temp timer:

if not testTimer then
testTimer = tempTimer(1,[[echo('this timer fired') killTimer(testTimer)]])
end

This timer only ever fires ONCE, I get/see the echo but on the next time this trigger fires, I never see it. When I test for the existence of testTimer (display(testTimer)) a number (usually 1) is returned. Even if I manually try to kill the timer through an alias (killTimer(testTimer) display(testTimer)) I still get a returned number, instead of nil.

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 5:30 pm
by Vadi
killTimer does not mess with the variable you're storing it in... in fact it's perfectly valid to do killTimer(1), and why should it be nil'ing out things then?

testTimer = tempTimer(1,[[echo('this timer fired') killTimer(testTimer); testTimer = nil]])

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 5:30 pm
by Vadi
killTimer does not mess with the variable you're storing it in... in fact it's perfectly valid to do killTimer(1), and why should it be nil'ing out things then?

testTimer = tempTimer(1,[[echo('this timer fired') killTimer(testTimer); testTimer = nil]])

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 5:53 pm
by Rakon
if the testTimer variable no longer exist via killTimer(testTimer) , I'd expect there to be nothing (NIL) returned instead of the address or integer previously held by it. If I have to implicitly nil out testTimer variable, why should I even use killTimer?

Thanks for the response though.

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 5:56 pm
by Parnakra
Documentation wrote:killTimer (id)
Deletes a tempTimer. Use the Timer ID returned by tempTimer() as name parameter. ID is a string and not a number. This function returns true on success and false if the timer id doesn't exist anymore (=timer has already fired) or the timer is not a temp timer. Note that non-temporary timers that you have set up in the GUI cannot be deleted with this function. Use disableTimer() to turn them on or off.
Parameters
id:
Return value:
true or false
So I'm guessing killTimer() is only useful when you (for whatever reason) want to prevent the (single) firing of a tempTimer().

/edit: And I'm not sure why (if possible) you couldn't use disableTimer() to do that.

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 8:51 pm
by Vadi
Rakon wrote:if the testTimer variable no longer exist via killTimer(testTimer) , I'd expect there to be nothing (NIL) returned instead of the address or integer previously held by it. If I have to implicitly nil out testTimer variable, why should I even use killTimer?

Thanks for the response though.
it's just a number ID. It's not a timer object.

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 10:05 pm
by Vadi
Feedback.

- spellcheck: the word detection algorithm incorrectly matched a exclamation mark at the end somehow... but then didn't continue it:
Image

- spellcheck also thinks that the apostrophe in "what's" is invalid.

Re: new features/functions in 1.2.0-pre8

Posted: Wed Dec 29, 2010 10:14 pm
by Vadi
- downloadFile - two issues, a) it requires the file that you'd like to download into to exist (otherwise it gives an 'No such file or directory' error), and b) when you do create it, it won't actually download - it'll say that it's done right away but file contents are unchanged.

Re: new features/functions in 1.2.0-pre8

Posted: Thu Dec 30, 2010 7:41 am
by Heiko
I can't confirm your 2 problems with downloadFile(). If the file does not exist it'll be created when the download has finished, otherwise the old file will be overwritten. If the resource that you want to download does not exist or is not available, however, it'll depend on the http server what kind of message you'll get. downloadFile() can only report network errors. Using ftp download instead of http might be easier to handle in this respect, but I haven't tried it. Otherwise you'll have to check the downloaded file content for http errors.