Mudlet-2.0 release candidates [latest: Mudlet 2.0 final]

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: new features/functions in 1.2.0-pre8

Post 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

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: new features/functions in 1.2.0-pre8

Post 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.

User avatar
Vadi
Posts: 4867
Joined: Sat Mar 14, 2009 3:13 pm

Re: new features/functions in 1.2.0-pre8

Post 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]])

User avatar
Vadi
Posts: 4867
Joined: Sat Mar 14, 2009 3:13 pm

Re: new features/functions in 1.2.0-pre8

Post 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]])

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: new features/functions in 1.2.0-pre8

Post 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.

Parnakra
Posts: 35
Joined: Tue Apr 21, 2009 10:48 am

Re: new features/functions in 1.2.0-pre8

Post 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.

User avatar
Vadi
Posts: 4867
Joined: Sat Mar 14, 2009 3:13 pm

Re: new features/functions in 1.2.0-pre8

Post 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.

User avatar
Vadi
Posts: 4867
Joined: Sat Mar 14, 2009 3:13 pm

Re: new features/functions in 1.2.0-pre8

Post 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.

User avatar
Vadi
Posts: 4867
Joined: Sat Mar 14, 2009 3:13 pm

Re: new features/functions in 1.2.0-pre8

Post 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.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: new features/functions in 1.2.0-pre8

Post 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.

Post Reply