I have a table that holds all the mobs in a room. I echo this list to a miniconsole. Each mob echoed to the miniconsole is followed by a link to target that mob. My my current target is highlighted within the miniconsole. This allows me to see all the mobs in a room, click to target any mob, and shows me what i am currently targeting.
I would like to create a hotkey that rotates my target, moving from my current target to the next target within this table, but I have been unable to figure out a way to do this and am looking for suggestions.
stepping/rotating through a table (tab targeting)
-
- Posts: 11
- Joined: Fri Feb 15, 2013 6:29 am
-
- Posts: 11
- Joined: Fri Feb 15, 2013 6:29 am
Re: stepping/rotating through a table (tab targeting)
I am getting there, now just need to figure out how to loop back to start.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: stepping/rotating through a table (tab targeting)
Can't you use, what is it, #room_object to get a count of the objects in the room_objects table - this ONLY works for tables (indexes starting at 1 and increasing monotonically) - I think that is how you use the '#' operator but if I am wrong I'm sure someone will say...
-
- Posts: 11
- Joined: Fri Feb 15, 2013 6:29 am
Re: stepping/rotating through a table (tab targeting)
it should work, but it always shows the table as empty (zero).
even if I run through something simply like this:
even if I run through something simply like this:
it will echo every object but still return a zero on #room_objects.
Last edited by BeardKingX on Wed Mar 09, 2016 6:16 am, edited 1 time in total.
-
- Posts: 11
- Joined: Fri Feb 15, 2013 6:29 am
Re: stepping/rotating through a table (tab targeting)
apparently the # operator only counts entries with integer keys, which room_objects does not have.
here is a working script
here is a working script
I have a trigger that sets mytarget when the mud server replies to the SETTARGET command.