Skip to content

Commit 84b1258

Browse files
authored
Merge pull request #27 from Zelec/bot-select-inv-fix
Fix for `bot.select` when using index number
2 parents 76a98e4 + 9c412c3 commit 84b1258

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

M1/assets/sysdisk/startup.ms

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,13 @@ if bot then
408408
end function
409409

410410
bot.select = function(toolNameOrIndex)
411+
inv = bot.inventory
411412
if toolNameOrIndex isa number then
412413
bot.currentToolIndex = toolNameOrIndex
413414
print "Using " + inv[toolNameOrIndex].name + " (index " + toolNameOrIndex + ")"
414415
return
415416
end if
416417
toolName = str(toolNameOrIndex).lower
417-
inv = bot.inventory
418418
for i in inv.indexes
419419
if inv[i] and inv[i].name.lower == toolName then
420420
bot.currentToolIndex = i

0 commit comments

Comments
 (0)