function sampGetListboxItemByText(text, plain)
if not sampIsDialogActive() then return -1 end
plain = not (plain == false)
for i = 0, sampGetListboxItemsCount() - 1 do
if sampGetListboxItemText(i):find(text, 1, plain) then
print(i)
sampSendDialogResponse(162,1, i,nil)
return i
end
end
return -1
end
local index = sampGetListboxItemByText('Mountain')
local index = sampGetListboxItemByText('%Mountain.-%a+', false)