GMCP room exits help, please

Post Reply
Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

GMCP room exits help, please

Post by Israafiyl »

hello again, I am trying to figure out how to pull the exits in the room I am currently in from GMCP as I was told this was something I can do. Could someone point me in the right direction or explain how I can do this? Very appreciated.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: GMCP room exits help, please

Post by Israafiyl »

I want to make an alias "RUN" and when I send the command it looks at GMCP exits and then goes in one of the exit directions can someone help me?

Delrayne
Posts: 159
Joined: Tue Jun 07, 2011 7:07 pm
Contact:

Re: GMCP room exits help, please

Post by Delrayne »

^run$
Code: [show] | [select all] lua
for k, v in pairs (gmcp.Room.Info.exits) do
  send(k)
  break
end

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: GMCP room exits help, please

Post by Manni »

Code: [show] | [select all] lua
^run$
local dir = {}

for i,_ in pairs(gmcp.Room.Info.exits) do
  table.insert(dir, i)
end

send(dir[math.random(#dir)])
I haven't tested this so there may be a couple errors in the script.
It will choose only one direction and send it once. It will not see hidden directions, nor does it differentiate doors or blocked exits.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: GMCP room exits help, please

Post by Israafiyl »

THank you both so very much

User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

Re: GMCP room exits help, please

Post by kevutian »

Code: [show] | [select all] lua
send(next(gmcp.Room.Info.exits))
Couldn't resist. Code consolidation and all...

Manni
Posts: 116
Joined: Tue May 31, 2011 9:00 pm

Re: GMCP room exits help, please

Post by Manni »

phasma wrote:
Code: [show] | [select all] lua
send(next(gmcp.Room.Info.exits))
Couldn't resist. Code consolidation and all...
You win this round!

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: GMCP room exits help, please

Post by Israafiyl »

when I try and use send(next(gmcp.Room.Info.exits)) there is some sort of error....
When I use
^run$
local dir = {}

for i,_ in pairs(gmcp.Room.Info.exits) do
table.insert(dir, i)
end

send(dir[math.random(#dir)])

I am wondering for a new alias how I could make myself force someone to go the direction what I had though about was

send(force "..attacker.. (dir[math.random(#dir)])
but this does force attackere or force attackerw how can I separate attacker and direction?

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: GMCP room exits help, please

Post by demonnic »

send("force " .. attacker .. " " .. dir[math.random(#dir)])

Post Reply