Skip to content

Commit

Permalink
Merge pull request #27 from Zelec/bot-select-inv-fix
Browse files Browse the repository at this point in the history
Fix for `bot.select` when using index number
  • Loading branch information
JoeStrout authored Jul 2, 2022
2 parents 76a98e4 + 9c412c3 commit 84b1258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion M1/assets/sysdisk/startup.ms
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ if bot then
end function

bot.select = function(toolNameOrIndex)
inv = bot.inventory
if toolNameOrIndex isa number then
bot.currentToolIndex = toolNameOrIndex
print "Using " + inv[toolNameOrIndex].name + " (index " + toolNameOrIndex + ")"
return
end if
toolName = str(toolNameOrIndex).lower
inv = bot.inventory
for i in inv.indexes
if inv[i] and inv[i].name.lower == toolName then
bot.currentToolIndex = i
Expand Down

0 comments on commit 84b1258

Please sign in to comment.