--Prevent standalone execution: if not TRAINSPORTED then print("To prevent players from harm, this file may only be executed by the trAInsported game.") return end --AI by Crashi: function ai.init() buyTrain(2,1) end function ai.foundPassengers(train, passengers) return passengers[1] end function ai.foundDestination(train) dropPassenger(train) end function ai.chooseDirection(train, dirs) -- dirs["N"]=true tbl = {} if dirs["N"] then table.insert(tbl, "N") end if dirs["S"] then table.insert(tbl, "S") end if dirs["E"] then table.insert(tbl, "E") end if dirs["W"] then table.insert(tbl, "W") end return tbl[random(#tbl)] end