Code: Select all
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> x = " 72 asdf"
> id, name = x:match("^%s*(%d+)%s*(.-)%s*$")
> print(id, "|"..tostring(name).."|")
72 |asdf|
Code: Select all
debugging_commands["set-GCKI-owner"] = function(command)
debugging.entered_command(command)
local id, owner = command.parameter and
command.parameter:match("^%s*(%d+)%s*(.-)%s*$")
AD.show("id", id)
AD.show("owner", owner)
end
Code: Select all
/set-GCKI-owner 72, asdf
Code: Select all
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Entered function for command AD-set-GCKI-owner(tick = 65147, player_index = 1, parameter = " 72, asdf")
(@__autodrive__/libs/debugging.lua: 754)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
10289.915 Script @__autodrive__/libs/debugging.lua:173: id: 72
10289.915 Script @__autodrive__/libs/debugging.lua:173: owner: nil