Minimal mapping script

Share your scripts and packages with other Mudlet users.
Post Reply
keevitaja
Posts: 21
Joined: Mon Aug 31, 2015 12:29 am

Minimal mapping script

Post by keevitaja »

Hello!

I am trying to create a mapping script, i think it throws lua error.
Code: [show] | [select all] lua
mudlet = mudlet or {}; mudlet.mapper_script = true

function readNewRoom()
    local info = gmcp.room.info

    addAreaName(info.zone)
    addRoom(info.num)
    setRoomCoordinates(info.num, info.coord.x, info.coord.y, info.coord.z)
    setRoomArea(info.num, info.zone)
    centerview(info.num)

    print("Mapper test: " .. info.zone)
end

registerAnonymousEventHandler("gmcp.room.info", "readNewRoom")
How can i display errors and/or what is wrong with this script. If i comment mapper functions the mapper test print works!

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: Minimal mapping script

Post by Belgarath »

Hey Keevitaja,

I notice you're using GMCP, which is generally an IRE thing. Mudlet has an IRE mapping script already and it is kept up-to-date with lots of useful functionalities. You can view it here.

In answer to your question, you can display errors by clicking on the Errors or Debug window within the Mudlet editor.

I'm not too familiar with GMCP, but I think the event handler would be gmcp.Room.Info, with the caps.

keevitaja
Posts: 21
Joined: Mon Aug 31, 2015 12:29 am

Re: Minimal mapping script

Post by keevitaja »

what is IRE?

I am playing aardwolf... and gmcp variable is correct in my script!

Post Reply