All pastes #608276 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-08 05:28 UTC
rendered paste body
; EVEBot - Alpha 0.2 7/5/07
; Skeleton taken from Fuergrissa and fixed by Tehtsuo
; Expanded upon and further bugfixed/documented by Stealthy
; Note: You may want to add additional possible cargohold pixels yourself. Using my exmaples,
; it's not hard to do. If you're stuck trying to drag cargo that isn't there, this is most likely
; your problem.
#include ./core/functions.iss



function DeclareState()
{
	if ${Me.ToEntity.Mode}==3
	{
		Return "WARP"
	}
	if ${Me.InStation} && (${Me.Ship.UsedCargoCapacity}==0) && !${WasTargeted}
	{
		Return "UNDOCK"
	}
	if !(${Me.Ship.UsedCargoCapacity}==0) && ${Entity[ID,${station}].Distance}<1000
	{
		Return "DOCK"
	}
	if ${WasTargeted} && ${Me.InStation}
	{
		Return "ENDSCRIPT"
	}
	if ((!${Me.Ship.UsedCargoCapacity}==0)||${WasTargeted}) && ${Entity[ID,${station}].Distance}>50000
	{
		Return "STATIONWARP"
	}
	if ((!${Me.Ship.UsedCargoCapacity}==0)||${WasTargeted}) && ${Entity[ID,${station}].Distance}<=50000
	{
		return "APPROACHSTATION"
	}
	if (${Me.Ship.UsedCargoCapacity}==0) && ${Entity[ID,${belt}].Distance}>50000 && UseBookmark == 0
	{
		Return "BELTWARP"
	}
	if (${Me.Ship.UsedCargoCapacity}==0) && ${Math.Distance[BookmarkX,BookmarkY,BookmarkZ,${Me.ToEntity.X},${Me.ToEntity.Y},${Me.ToEntity.Z}]} > 50000 && UseBookmark == 1
	{
		Return "BOOKWARP"
	}
	if (${Me.Ship.UsedCargoCapacity} == 0) && ${roid}==0 && ((${Entity[ID,${belt}].Distance}<=50000 && UseBookmark == 0) || (UseBookmark == 1 && ${Math.Distance[BookmarkX,BookmarkY,BookmarkZ,${Me.ToEntity.X},${Me.ToEntity.Y},${Me.ToEntity.Z}]} <= 50000)) || !${Entity[ID,${AsteroidID}].ID} > 0
	{
		Return "SELECTROID"
	}
	if (${Me.Ship.UsedCargoCapacity}==0) && !${roid}==0 && (${Entity[ID,${belt}].Distance}<=50000 && UseBookmark == 0) || (${Math.Distance[BookmarkX,BookmarkY,BookmarkZ,${Me.ToEntity.X},${Me.ToEntity.Y},${Me.ToEntity.Z}]} <= 50000 && UseBookmark == 1) && ${Entity[ID,${roid}].Distance}>9000
	{
		Return "APPROACHROID"
	}
	if (${Me.Ship.UsedCargoCapacity}==0) && !${roid}==0 && (${Entity[ID,${belt}].Distance}<=50000 && UseBookmark == 0) || (${Math.Distance[BookmarkX,BookmarkY,BookmarkZ,${Me.ToEntity.X},${Me.ToEntity.Y},${Me.ToEntity.Z}]} <= 50000 && UseBookmark == 1) && ${Entity[ID,${roid}].Distance}<=9000
	{
		Return "MINEROID"
	}
	Return "NONE"
}

function main()
{
	declare station int script ${Entity[CategoryID,3].ID}
	declare belt int script ${Entity[GroupID,9].ID}
	declare roid int script
	declare botstate string
	declare WasTargeted bool script
	variable bool AsteroidID
	
	call LoadCoordinates
	
	While ${botstate.NotEqual[END]} 
	{
		call DeclareState
		botstate:Set[${Return}]
		echo ${botstate}

		Switch ${botstate}
		{
			case ENDSCRIPT
				endscript evebot
			case WARP
				waitframe
				break
			case UNDOCK
				call DragToHangar
				call StackAll
				Me:Undock
				do
				{
					wait 10
				}
				while ${Me.InStation}
				wait 100
				belt:Set[${Entity[GroupID,9].ID}]
				break
			case DOCK
				Entity[ID,${station}]:Dock
				do
				{
					wait 10
				}
				while !${Me.InStation}
				wait 50
				break
			case STATIONWARP
				Entity[ID,${station}]:WarpTo
				do
				{
					wait 10
				}
				while !${Me.ToEntity.Mode}==3
				break
			case APPROACHSTATION
				Entity[ID,${station}]:Approach
				do
				{
					wait 10
				}
				while ${Entity[ID,${station}].Distance} > 100
				break
			case BELTWARP
				wait 50
				Entity[ID,${belt}]:WarpTo
				do
				{
					wait 10
				}
				while !${Me.ToEntity.Mode}==3
				break
			case BOOKWARP
				wait 50
				call BookmarkWarp
				do
				{
					wait 10
				}
				while !${Me.ToEntity.Mode}==3
				break
			case SELECTROID
				roid:Set[${Entity[CategoryID,25].ID}]
				AsteroidID:Set[${Entity[ID,${roid}].ID}]
				echo ${roid} selected
				break
			case APPROACHROID
				Entity[ID,${roid}]:Orbit
				do
				{
					wait 10
				}
				while !${Entity[ID,${roid}].Distance}<=9000
				break
			case MINEROID
				call MineRoid ${roid}
				roid:Set[0]
				break
			case NONE
				waitframe
				break
		}
	}
}