wtf does that blue text say? Can't read it in the background...
The GUI can be automated like so:
Code:
local itemScript = assert(AddressList.getMemoryRecordByDescription'Item Gib')
local function child(description)
for i = 0, itemScript.Count - 1 do
if itemScript.Child[i].Description == description then
return itemScript.Child[i]
end
end
end
local itemSpawn = assert(child'<- Spawn Item')
local itemName = assert(child'Weapon Name')
local itemValues = {}
local ddl = itemName.DropDownList
for i = 0, ddl.Count - 1 do
itemValues[i+1] = assert((ddl[i]):match'^%s*(%x+)%s*:', ddl[i])
end
function giveRandomItem()
assert(itemScript.Active)
if itemSpawn.Active then
itemSpawn.Active = false
end
itemName.Value = itemValues[math.random(1,#itemValues)]
itemSpawn.Active = true
end
Then just call giveRandomItem when you want. e.g. hotkey:
Code:
if giveRandomItemHK then giveRandomItemHK.destroy(); giveRandomItemHK = nil end
-- see `defines.lua` in the main CE directory for most `VK_WHATEVER` values
giveRandomItemHK = createHotkey(giveRandomItem, VK_NUMPAD0)
If it doesn't work and you can't figure it out (e.g. descriptions might be wrong), post any errors as well as the contents of that blue script and the spawn item script. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum