Search found 22 matches

by visionok
Sun Mar 14, 2021 3:06 pm
Forum: Help Forum
Topic: Special exits as normal exits
Replies: 2
Views: 1484

Re: Special exits as normal exits

IIRC zmud allowed for something like, ie map a special exit to one of the standard compass directions and hence use the number keypad to walk around. Did you/anyone implement this, if so how is it working? I'm going to have a try to see if I can get it to work.
by visionok
Sun Mar 14, 2021 2:58 pm
Forum: Help Forum
Topic: Global exits
Replies: 14
Views: 5191

Re: Global exits

I've been using Aardwolf Mudlet Module for a few weeks, and have implemented a portals system as described here, ie just before path finding add all portal destinations as special exits out of the current room then after path finding remove them. I have less than 30 portals at the moment and I have ...
by visionok
Sat Mar 13, 2021 9:06 am
Forum: Help Forum
Topic: How to use db:_begin(), db:_commit(), db:_end() ?
Replies: 3
Views: 186

Re: How to use db:_begin(), db:_commit(), db:_end() ?

Yeah, the updates are much quicker now, thanks. if map_room_count > db_room_count then update_db = true display("Updating DB") dbh:_begin() local i, r for i, r in pairs(endresult) do res = db:add(dbh.area_rooms, {room = r, id = i, area=area.current}) if res == nil then display("error ...
by visionok
Thu Mar 11, 2021 3:50 pm
Forum: Help Forum
Topic: How to use db:_begin(), db:_commit(), db:_end() ?
Replies: 3
Views: 186

How to use db:_begin(), db:_commit(), db:_end() ?

I want to do a bunch of inserts into a database, if I do them one by one, it takes quite a while (seconds or more,lots of disk thrashing) for relatively few entries (eg 10's of entries). So I surrounded the insertions/updates with db:_begin(), db:_commit(), db:_end() local dbh = db:get_database(&quo...
by visionok
Thu Mar 11, 2021 3:37 pm
Forum: Help Forum
Topic: Really basic module scope question
Replies: 3
Views: 253

Re: Really basic module scope question

I was looking for a way to show the currently defined "global" variables, your mention of _G seemed to be just what I need. So I tried lua _G and lua display(_G) both resulted in mudlet going into some frenzy (using all the CPU) and needing killing. Is there any way to show global variables?
by visionok
Tue Mar 09, 2021 10:44 am
Forum: Scripts & Packages
Topic: Autosave Map
Replies: 3
Views: 270

Re: Autosave Map

Interesting, I was going to implement "save only when map has changed" but using the simple condition of whether the number of mapped rooms has changed. But then I didn't bother since the save operation is quick and unobtrusive plus disk space is cheap. However I'm curious to know how you ...
by visionok
Mon Mar 08, 2021 7:14 pm
Forum: Help Forum
Topic: Unexpected output from getAreaRooms()
Replies: 4
Views: 282

Re: Unexpected output from getAreaRooms()

That's a shame. I'm using a tempTimer() to call a function to process that table using table.remove(), so each time the timer is activated it removes and process the first item in the table then if table is not empty creates a new tempTimer() to call the function again. table.remove() does not work ...
by visionok
Mon Mar 08, 2021 7:01 pm
Forum: Scripts & Packages
Topic: Autosave Map
Replies: 3
Views: 270

Autosave Map

Having lost a fair bit of mapping on a couple of occasions I decided to create a timer to autosave the map. The code itself is pretty much as per the wiki manual, I just changed the filename format to match the files that mudlet creates on closing profile. local map_name = getTime(true, "yyyy-M...
by visionok
Mon Mar 08, 2021 11:18 am
Forum: Help Forum
Topic: Unexpected output from getAreaRooms()
Replies: 4
Views: 282

Unexpected output from getAreaRooms()

Here's what I get lua getAreaRooms(7) { 67, 64, 65, 63, [0] = 66 } I was expecting it to be { 67, 64, 65, 63, 66 } I've tried a number of different areas and they all have that [0] = nn entry at the end of the table. Is it supposed to behave that way? I'm using the AppImage v4.10.1.
by visionok
Sat Mar 06, 2021 5:19 pm
Forum: Help Forum
Topic: How to use Lua scripts in addSpecialExit()
Replies: 5
Views: 369

Re: How to use Lua scripts in addSpecialExit()

It was quite straightforward, just copied and adapted a couple of lines from mudlet-mapper.xml. Now I've got a working portal system incorporated into the mapper :)