--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 LeMas: function ai.init() buyTrain(1,1) buyTrain(10,7) cross = 0 count = 0 end function ai.foundPassengers(train, passengers) return passengers[1] end function ai.foundDestination(train) dropPassenger(train) end function ai.chooseDirection(train, dirs) buyTrain(10,7) random = math.random(4) print (random) if random == 1 then return "N" end if random == 2 then return "S" end if random == 3 then return "E" end if random == 4 then return "W" end -- count = count+1 -- print(cross) -- cross = cross+1 -- print(cross) -- if cross == 5 then cross = 0 end -- if cross == 1 then -- return "E" -- elseif cross == 2 then -- return "W" -- elseif cross == 3 then -- return "S" -- else -- return "N" -- end end