possible bug with events

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

possible bug with events

Post by Caled » Sat Apr 25, 2009 10:01 am

I got my event working, or at least the first stage of it.

Code: Select all

Script name: onEqbal_stand
Registered event handers: onEqbal

function onEqbal_stand( onEqbal )
    if string.find( pstats, "p" ) >= 1 then
        send( "stand" )
    end
end
This is working well. It makes me stand whenever I need to and are able.

I was then curious what would happen if I had another script item, with an event handler function in it that was called by that same onEqbal handler.

Code: Select all

Script name: onEqbal_test
Registered event handlers: onEqbal

function onEqbal_test( onEqbal )
    echo( "oneqbal test script echo" )
end
When the event is raised now, mudlet closes without warning or error message. Sometimes just clicking on that script item in the script editor will cause mudlet to close.

The first time it happened, there was a windows error message.
Microsoft Visual C++ Runtime Library

Runtime Error
Program:

This application has requested the runtime to terminate it in and unusual way. Please contact the applications support team for more information.
This is reproducible. I delete the offending script, restart mudlet, create the script again, and it will crash, once more showing that error message. If I just restart mudlet and run the script again without deleting and recreating, then mudlet simply closes without warning or error message.

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

Re: possible bug with events

Post by Heiko » Sat Apr 25, 2009 12:03 pm

That's clearly a bug. I'll look after it and fix it.

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

Re: possible bug with events

Post by Heiko » Sat Apr 25, 2009 12:25 pm

OK. It was an obvious bug. I fixed it in my local version. I'll release Beta-10 on sunday.

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

Re: possible bug with events

Post by Caled » Sat Apr 25, 2009 1:04 pm

Thanks!

While on the topic though, the reason I made that test event handler function to begin with, was to see which one of the two would fire first, and if there is some way for me to designate that.

For example, if I have my onEqbal event, with three event handler functions:

onEqbal_stand
onEqbal_weaponSwitching
onEqbal_parrySwitching

It may not matter when I stand, but the other two must be in that order. I may be switching between a two-handed weapon and a single-handed weapon, which means I have to adjust my parrying after the weapons have changed. I know I could do it all in one function, but on another character I may parry in a totally different way, so my idea was to have parrying as its own event handler function.

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

Re: possible bug with events

Post by Heiko » Sat Apr 25, 2009 1:14 pm

Sure, you can set up the order in which the handlers are called with drag & drop. The first on the list if called first, then the second etc.. This is the same with all tree items in Mudlet, triggers, alias, scripts etc..

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

Re: possible bug with events

Post by Caled » Thu Apr 30, 2009 12:55 am

Hi Heiko

Some bad news - this bug still exists in beta 10. On Ubuntu it also just closes without warning from the first time. Is there any more information I can give to you to help?

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

Re: possible bug with events

Post by Heiko » Thu Apr 30, 2009 9:03 am

Beta-10 isn't released yet. The latest Ubuntu version is a bit newer than the latest windows version at the moment, but it's still at least a week old.

To get the fixes, you'll need to compile the latest git version. Beta-10 won't be released before Saturday.

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

Re: possible bug with events

Post by Caled » Thu Apr 30, 2009 9:28 am

Heiko wrote:Beta-10 isn't released yet. The latest Ubuntu version is a bit newer than the latest windows version at the moment, but it's still at least a week old.

To get the fixes, you'll need to compile the latest git version. Beta-10 won't be released before Saturday.
Hrm. I thought I did compile the latest git, though it was a bit confusing. I installed mudlet first by setting the software source and then using synaptic to install it. I aftwards went to the terminal and followed the instructions for using git and compiling it. I Assumed it compiled to the same location as the original mudlet install, but perhaps there are now two instances of mudlet.

I'll check it out. I've done a whole lot of planning for my system, and writing stuff in without being able to test it. I'm keen to see if any of my stuff works :?

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

Re: possible bug with events

Post by Heiko » Thu Apr 30, 2009 9:50 am

Don't use synaptic. This will install the latest ubuntu binaries, which is old.

You can use synaptic to install the dependencies to compile Mudlet from source code though i.e. Lua5.1, qscintilla2.3, qt4.4 or 4.5 and pcre. Additionally, install devel packages of all of the above packages.
On ubuntu you also need to install a c++ compiler with the package build-essentials.

Then download the latest snapshot of Mudlet from git, unpack it in your home directory.
cd mudlet/src
cmake ./
make
Then you can run the new mudlet version with ./mudlet. Be careful to run
/home/caled/mudlet/src/mudlet and not just "mudlet" which will be the
old ubuntu binary in /bin/mudlet. That's a typical pitfall.
You can use a desktop icon to run the new version of mudlet.

Caled
Posts: 399
Joined: Thu Apr 09, 2009 4:45 am

Re: possible bug with events

Post by Caled » Thu Apr 30, 2009 10:02 am

Heiko wrote:Then download the latest snapshot of Mudlet from git, unpack it in your home directory.
cd mudlet/src
cmake ./
make
Then you can run the new mudlet version with ./mudlet. Be careful to run
/home/caled/mudlet/src/mudlet and not just "mudlet" which will be the
old ubuntu binary in /bin/mudlet. That's a typical pitfall.
You can use a desktop icon to run the new version of mudlet.
After I installed it through synaptic, and realised that wasn't the latest version, I went back to the website and followed the instructions. I didn't download the archive though, I did:
git clone git://mudlet.git.sourceforge.net/gitroot/mudlet
followed by
cmake .
make

I think where I went wrong though, is that installed a separate instance of mudlet, but I ran it from the GUI rather than the terminal, which ran the older version of mudlet.

And now I don't have either because I screwed up the dual boot install of win xp and lost the whole ubuntu install. I chose fat32 in gparted when making the partition for windows, and my window install refused to accept anything except ntfs. Instead of booting gparted again and reformatting the partition from there, I let a different windows install disk (window 7) do it, and that ruined ubuntu as well.

I did get to laugh at the ridiculousness of Win XP requiring a gparted live disk to install, though ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests