AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please check

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Sally'
Guest





PostPosted: Mon Oct 26, 2009 8:21 pm    Post subject: Please check Reply with quote

Not sure why my topic was deleted Confused. I'll ask again. Can someone check this code to make sure there's nothing bad inside. I don't want to run it until I know for certain.

Code:
#NoEnv
Inifile        = %A_ScriptDir%\Default.ini
SMVersion      = 1.5.5
OnExit, ExitSub

currentrunnumber = 0

IfExist, %Inifile%
{
   IniRead,Deafultiniver,   %Inifile%,Common,Defaultiniver
   IfNotEqual,Deafultiniver,%SMVersion%
      MsgBox, 64, Change Log, Version: %SMVersion%`n Tested on APOCRYPHA 1.3`n Released: 7/09/09
}else
{
   gosub CreateSettings
}

SetDefaultMouseSpeed, 4
SetWorkingDir, %A_ScriptDir%
Setkeydelay, 150
SetTitleMatchMode, 3
SetBatchLines -1
SysGet windowOffsetY, 31
windowOffsetY -= 18
FastMouseSpeed=1
BonusTime=0
ApproachClickInterval=15

If (windowOffsetY>0)
{
   MsgBox, 64, Windows Theme, You are not running in the Windows Classic theme. This CAN cause serious issues. Please change your theme!, 5
}

AppendLogin=0
AppendFirstRun=0
AppendPrestart=0
AppendInstation=0
AppendNavigation1=0
AppendEnterMining=0
AppendLaserControl=0
AppendManeuvering=0
AppendNavigation2=0
AppendCargo=0
AppendDistance=0
AppendLasers=0
AppendDTandMessages=0
AppendFM=0
AppendHP=0
dronemenupattern=0
OviewPatternVar=0
EWVar=0
MiningMethod=1

CargoVolume:=
CurrentCargo:=
BestTime=9999999999
BestBelt=
NPCAttacks=0
NPCKilled=0
AsteroidType=Not Defined
CargoVolume=Not Defined
YieldM3PerMinute=Not Calculated

IniRead, FirstRun, %Inifile%, Mining ,FirstRun, yes

gosub, LoadSettings

If (FirstRun = "yes")
   PreStartEnable=DISABLED
else
   PreStartEnable=""

Menu Tray, NoStandard
Menu, Tray, Add, &Pause , Pause
Menu, Tray, Add, E&xit , ExitSub
Menu, Tray, Tip, RoidRipper

Menu, BackUpMenu, Add, Backup settings (from location specified in "Directory"), BackupSettings
Menu, BackUpMenu, Add, BackUp settings on start, BackUpSettingsOnStartSub
Menu, BackUpMenu, Add
Menu, BackUpMenu, Add, Restore settings (to location specified in "Directory"), RestoreSettings
Menu, BackUpMenu, Add, Restore settings on exit, RestoreSettingsOnExitSub
Menu, BackUpMenu, Add
Menu, BackUpMenu, Add, Erase Settings, EraseSettings
Menu, BackUpMenu, Add, Create pc.dat, CreatePCdat

IfNotExist, %A_ScriptDir%\BackUPFolder
{
   Menu, BackUpMenu, disable, Restore settings (to location specified in "Directory")
   Menu, BackUpMenu, disable, Restore settings on exit
}

IniRead, RestoreSettingsOnExit, %Inifile%,Mining,RestoreSettingsOnExit,0
IniRead, BackUpSettingsOnStart, %Inifile%,Mining,BackUpSettingsOnStart,0

Gui,25: Add, Edit, x10 y10 W300 H300 vlicense,%license%
Gui,25: Add, Button, x10 y320 W300 H20 -Wrap gupdatelicense, Update License
Gui,25: Hide

IfEqual,BackUpSettingsOnStart,1
   Menu, BackUpMenu, check, BackUp settings on start
else
   Menu, BackUpMenu, uncheck, BackUp settings on start

IfEqual,RestoreSettingsOnExit,1
   Menu, BackUpMenu, check, Restore settings on exit
else
   Menu, BackUpMenu, uncheck, Restore settings on exit

Menu, HelpMenu, Add,Help, helpreadme
Menu, HelpMenu, Add, About , helpabout

Menu, MenuBar, Add, &Back Up, :BackUpMenu
Menu, MenuBar, Add, &Help, :HelpMenu

Gui, Menu, MenuBar
Gui, Add, Tab, x2 y3 w545 h365 , General Settings|Fighter Module Settings|Custom Settings|Statistics|Traveling|Debugger
Gui, Tab, General Settings

Gui, Add, GroupBox, x6 y27 w340 h90 ,
Gui, Add, Text, x16 y40 w100 h20 , Directory (\ccp\eve)
Gui, Add, Text, vusernametext x16 y70 w100 h20 , Username
Gui, Add, Text, vpasswordtext x16 y90 w100 h20 , Password
Gui, Add, Edit, x116 y40 w190 h20 gDisablePS vprogram, %program%
Gui, Add, Button, x306 y40 w30 h20 gSelectEvePath, ...,
Gui, Add, Edit, x116 y65 w90 h20 DISABLED, Enter Manually
Gui, Add, Edit, x116 y65 w90 h20 gDisablePS vusername , %username%
Gui, Add, Edit, x116 y90 w90 h20 DISABLED, Enter Manually
Gui, Add, Edit, x116 y90 w90 h20 gDisablePS Password vPassword, %Password%
Gui, Add, CheckBox, x216 y90 w110 h20 gUpdate vManuallogin checked%manuallogin%, Manual Login
Gui, Add, DropDownList, x210 y65 w90 r3 gDisablePS choose%Character% vGuiCharacter, Top|Main|Bottom

Gui, Add, GroupBox, x6 y117 w340 h240 , Miner Setup
Gui, Add, Text, x16 y138 w80 h20 , Mining lasers
Gui, Add, Edit, x106 y137 w60 h20 Number vNumberOfLasers, %NumberOfLasers%
Gui, Add, Text, x176 y132 w90 vAsteroidsToTrackText, Asteroids to keep`nin optimal range
Gui, Add, DropDownList, x266 y137 w50 vAI_level Choose%AI_Level%, 1|2|3|4|5|6|7|8|9|10|11|12|13|14
Gui, Add, Text, x16 y163 w200 h20 ,Total # of bookmarks (inc. station).
Gui, Add, CheckBox, x232 y162 w90 h20 gUpdate vRandomBelts checked%RandomBelts%,Random belts
Gui, Add, Edit, x186 y161 w40 h20 DISABLED, 1-station
BookMarkNumberGUI:=MaxBookMarkNumber-1
Gui, Add, DropDownList, x186 y161 w40 vMaxBookMarkNumber choose%BookMarkNumberGUI%, 2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20
Gui, Add, Text, x16 y188 w150 h20 , Maximal approach distance (m)
Gui, Add, Edit, x230 y185 w90 h20 Number vFirstApproachRange, %FirstApproachRange%
Gui, Add, Text, x16 y213 w150 h20 vMiningAmountPerLaserText, Mining amount per laser (m^3)
Gui, Add, Edit, x230 y210 w90 h20 Number vMiningAmount, %MiningAmount%
Gui, Add, Text, x16 y238 w180 h20 , Laser activation time/duration (sec)
Gui, Add, Edit, x230 y235 w90 h20 Number vRoundDuration, %RoundDuration%
Gui, Add, Text, x16 y262 w150 h20 , Laser optimal range (m)
LaserOptimalRangeTrue:=LaserOptimalRange+1000
Gui, Add, Edit, x230 y260 w90 h20 Number vLaserOptimalRangeTrue, %LaserOptimalRangeTrue%
Gui, Add, Text, x16 y287 w150 h20 , Maximum # of locked targets
Gui, Add, Edit, x270 y284 w50 h20 Number vNumberOfTargets, %NumberOfTargets%
Gui, Add, Text, x16 y311 w150 h20 , Max mining time per trip (sec)
Gui, Add, Edit, x270 y307 w50 h20 Number vTripDuration, %TripDuration%
Gui, Add, Text, x16 y335 h20 vSwitchOffLasersText, Switch off lasers every (sec)

If (LasersOFFTimer=0)
   LasersOFFTimerVar=1
If (LasersOFFTimer=60)
   LasersOFFTimerVar=2
If (LasersOFFTimer=90)
   LasersOFFTimerVar=3
If (LasersOFFTimer=120)
   LasersOFFTimerVar=4
If (LasersOFFTimer=150)
   LasersOFFTimerVar=5
Gui, Add, DropDownList, x239 y330 w80 vLasersOFFTimer choose%LasersOFFTimerVar%, 0|60|90|120|150

Gui, Add, GroupBox, x356 y27 w180 h270 , What to mine
Gui, Add, CheckBox, x364 y44 w80 h20 gUpdateIce vRoidAncientIce Checked%RoidAncientIce%, Ancient Ice
Gui, Add, CheckBox, x364 y64 w80 h20 gUpdateOre vRoidArkonor Checked%RoidArkonor%, Arkonor
Gui, Add, CheckBox, x364 y84 w80 h20 gUpdateOre vRoidBistot Checked%RoidBistot%, Bistot
Gui, Add, CheckBox, x364 y104 w80 h20 gUpdateOre vRoidCrokite Checked%RoidCrokite%, Crokite
Gui, Add, CheckBox, x364 y124 w80 h20 gUpdateOre vRoidDarkOchre Checked%RoidDarkOchre%, DarkOchre
Gui, Add, CheckBox, x364 y144 w80 h20 gUpdateOre vRoidGneiss Checked%RoidGneiss%, Gneiss
Gui, Add, CheckBox, x364 y164 w80 h20 gUpdateOre vRoidHedbergite Checked%RoidHedbergite%, Hedbergite
Gui, Add, CheckBox, x364 y184 w80 h20 gUpdateOre vRoidHemorphite Checked%RoidHemorphite%, Hemorphite
Gui, Add, CheckBox, x364 y204 w80 h20 gUpdateIce vRoidIce Checked%RoidIce%, Ice
Gui, Add, CheckBox, x364 y224 w80 h20 gUpdateOre vRoidJaspet Checked%RoidJaspet%, Jaspet
Gui, Add, CheckBox, x450 y44 w80 h20 gUpdateOre vRoidKernite Checked%RoidKernite%, Kernite
Gui, Add, CheckBox, x450 y64 w80 h20 gUpdateOre vRoidMercoxit Checked%RoidMercoxit%, Mercoxit
Gui, Add, CheckBox, x450 y84 w80 h20 gUpdateOre vRoidOmber Checked%RoidOmber%, Omber
Gui, Add, CheckBox, x450 y104 w80 h20 gUpdateOre vRoidPlagioclase Checked%RoidPlagioclase%, Plagioclase
Gui, Add, CheckBox, x450 y124 w80 h20 gUpdateOre vRoidPyroxeres Checked%RoidPyroxeres%, Pyroxeres
Gui, Add, CheckBox, x450 y144 w80 h20 gUpdateOre vRoidScordite Checked%RoidScordite%, Scordite
Gui, Add, CheckBox, x450 y164 w80 h20 gUpdateOre vRoidSpodumain Checked%RoidSpodumain%, Spodumain
Gui, Add, CheckBox, x450 y184 w80 h20 gUpdateTerrain vRoidTerrain Checked%RoidTerrain%, Terran Artif.
Gui, Add, CheckBox, x450 y204 w80 h20 gUpdateOre vRoidVeldspar Checked%RoidVeldspar%, Veldspar
Gui, Add, Button, x366 y247 w40 h20 gSelectAllOre, &Ore
Gui, Add, Button, x426 y247 w40 h20 gSelectAllIce, &Ice
Gui, Add, Button, x486 y247 w40 h20 gSelectNone, &None
If((RoidAncientIce+RoidArkonor+RoidBistot+RoidCrokite+RoidDarkOchre+RoidGneiss+RoidHedbergite+RoidHemorphite+RoidIce+RoidJaspet+RoidKernite+RoidMercoxit+RoidOmber+RoidPlagioclase+RoidPyroxeres+RoidScordite+RoidSpodumain+RoidTerrain+RoidVeldspar) > 1)
   Gui, Add, CheckBox, x364 y274 w150 h20 vReloadCrystals Disabled 0, Reload crystals
Else
   Gui, Add, CheckBox, x364 y274 w150 h20 vReloadCrystals Checked%ReloadCrystals%, Reload crystals


Gui, Add, Button, x356 y303 w180 h28 vSMFT1 gMaintenance, &Start mining for the first time
Gui, Add, Button, x356 y336 w180 h28 vPS1 gPreStart %PreStartEnable%, &Continue mining


Gui, Tab, Fighter Module Settings
Gui, Add, CheckBox, x16 y257 w180 h20 vSwitchOffLaserDuringFight Checked%SwitchOffLaserDuringFight%, Switch off lasers during fight
Gui, Add, Text, x16 y297 w130 h20 , Fight Drones:
FightDronesGUIVar:=FightDrones+1
Gui,Add, DropDownList, x176 y297 w90 r3 gUpdateDrones choose%FightDronesGUIVar% vFightDrones, 0|1|2|3|4|5
Gui, Add, Text, x296 y37 w120 h20 vNumberOfHardenerstext, Active Resist Modules:
NumberOfHardenersGUIVar:=NumberOfHardeners+1
Gui, Add, DropDownList, x436 y37 w60 r3 gUpdateModules choose%NumberOfHardenersGUIVar% vNumberOfHardeners, 0|1|2|3|4

Gui, Add, Text, x16 y327 w130 h20 vMaxDroneFightDistanceText, Drone Control Distance:
Gui, Add, Edit, x176 y327 w90 h20 Number VMaxDroneFightDistance, %MaxDroneFightDistance%
Gui, Add, Text, vUpdateWarpOutSlider x156 y161 w130 h40, Emergency warpout at shield/armor lvl %CriticalDamagePercent% (`%):
Gui, Add, Slider, x156 y207 w130 h20 0x100 +Tickinterval25 vCriticalDamagePercent gUpdateWarpOutSlider range1-100, %CriticalDamagePercent%

Gui, Add, GroupBox, x156 y37 w130 h120 , Passive Tank Protection

Gui, Add, Radio, x26 y57 w110 h20 0x1000 gUpdate vRepairModulePresent Checked%RepairModulePresent%, Active Tank
Gui, Add, Radio, x166 y57 w110 h20 0x1000 gUpdate, Passive Tank
Gui, Add, Text, vUpdatePassiveTankSlider x166 y84 w110 h40 , Enter Combat at Shield lvl %PassiveTankFightActivationPercent% (`%):
Gui, Add, Slider, x166 y127 w110 h20 0x100 +Tickinterval25 gUpdatePassiveTankSlider vPassiveTankFightActivationPercent range1-100, %PassiveTankFightActivationPercent%
Gui, Add, GroupBox, x16 y37 w130 h200 , Active Tank Protection
Gui, Add, Radio, x26 y87 w110 h20 vShieldTanking Checked%ShieldTanking%, Shield Tank or...
Gui, Add, Radio, x26 y107 w110 h20 vArmorTanking Checked%ArmorTanking%, Armor Tank

Gui, Add, Text, x20 y135 w35 vSBPlaceText, RepPos:

If (SBPlace="Med-1")
   SBPlaceTemp=1
If (SBPlace="Med-2")
   SBPlaceTemp=2
If (SBPlace="Med-3")
   SBPlaceTemp=3
If (SBPlace="Med-4")
   SBPlaceTemp=4
If (SBPlace="Med-5")
   SBPlaceTemp=5
If (SBPlace="Med-6")
   SBPlaceTemp=6
If (SBPlace="Med-7")
   SBPlaceTemp=7
If (SBPlace="Med-8")
   SBPlaceTemp=8
If (SBPlace="Low-1")
   SBPlaceTemp=9
If (SBPlace="Low-2")
   SBPlaceTemp=10
If (SBPlace="Low-3")
   SBPlaceTemp=11
If (SBPlace="Low-4")
   SBPlaceTemp=12
If (SBPlace="Low-5")
   SBPlaceTemp=13
If (SBPlace="Low-6")
   SBPlaceTemp=14
If (SBPlace="Low-7")
   SBPlaceTemp=15
If (SBPlace="Low-8")
   SBPlaceTemp=16

Gui, Add, DropDownList, x66 y130 w75 vSBPlace choose%SBPlaceTemp%, Med-1|Med-2|Med-3|Med-4|Med-5|Med-6|Med-7|Med-8|Low-1|Low-2|Low-3|Low-4|Low-5|Low-6|Low-7|Low-8

Gui, Add, Text, vUpdateActiveTankSlider x26 y157 w110 h40 , Activate repairer module at shield/armor level %RepairModuleActivationPercent% (`%):
Gui, Add, Slider, x26 y207 w110 h20 0x100 +Tickinterval25 gUpdateActiveTankSlider vRepairModuleActivationPercent range1-100, %RepairModuleActivationPercent%

Gui, Add, Text, x296 y67 w150 h30 vModule1activationText, Activate module 1 at shield or`narmor level %Module1ActivationPercent% (`%):
Gui, Add, Slider, x296 y97 w150 h20 0x100 +Tickinterval25 gUpdatemodule1activationslider vModule1ActivationPercent range1-100, %Module1ActivationPercent%
Loop, 4
{
   If (Module%A_Index%Place="Med-1")
      Module%A_Index%PlaceTemp=1
   If (Module%A_Index%Place="Med-2")
      Module%A_Index%PlaceTemp=2
   If (Module%A_Index%Place="Med-3")
      Module%A_Index%PlaceTemp=3
   If (Module%A_Index%Place="Med-4")
      Module%A_Index%PlaceTemp=4
   If (Module%A_Index%Place="Med-5")
      Module%A_Index%PlaceTemp=5
   If (Module%A_Index%Place="Med-6")
      Module%A_Index%PlaceTemp=6
   If (Module%A_Index%Place="Med-7")
      Module%A_Index%PlaceTemp=7
   If (Module%A_Index%Place="Med-8")
      Module%A_Index%PlaceTemp=8
   If (Module%A_Index%Place="Low-1")
      Module%A_Index%PlaceTemp=9
   If (Module%A_Index%Place="Low-2")
      Module%A_Index%PlaceTemp=10
   If (Module%A_Index%Place="Low-3")
      Module%A_Index%PlaceTemp=11
   If (Module%A_Index%Place="Low-4")
      Module%A_Index%PlaceTemp=12
   If (Module%A_Index%Place="Low-5")
      Module%A_Index%PlaceTemp=13
   If (Module%A_Index%Place="Low-6")
      Module%A_Index%PlaceTemp=14
   If (Module%A_Index%Place="Low-7")
      Module%A_Index%PlaceTemp=15
   If (Module%A_Index%Place="Low-8")
      Module%A_Index%PlaceTemp=16
}

Gui, Add, DropDownList, x460 y85 w75 vModule1Place choose%Module1PlaceTemp%, Med-1|Med-2|Med-3|Med-4|Med-5|Med-6|Med-7|Med-8|Low-1|Low-2|Low-3|Low-4|Low-5|Low-6|Low-7|Low-8

Gui, Add, Text, x296 y117 w150 h30 vModule2activationText, Activate module 2 at shield or `narmor level %Module2ActivationPercent% (`%):
Gui, Add, Slider, x296 y147 w150 h20 0x100 +Tickinterval25 gUpdatemodule2activationslider vModule2ActivationPercent range1-100, %Module2ActivationPercent%
Gui, Add, DropDownList, x460 y135 w75 vModule2Place choose%Module2PlaceTemp%, Med-1|Med-2|Med-3|Med-4|Med-5|Med-6|Med-7|Med-8|Low-1|Low-2|Low-3|Low-4|Low-5|Low-6|Low-7|Low-8

Gui, Add, Text, x296 y167 w150 h30 vModule3activationText, Activate module 3 at shield or `narmor level %Module3ActivationPercent% (`%):
Gui, Add, Slider, x296 y197 w150 h20 0x100 +Tickinterval25 gUpdatemodule3activationslider vModule3ActivationPercent range1-100, %Module3ActivationPercent%
Gui, Add, DropDownList, x460 y185 w75 vModule3Place choose%Module3PlaceTemp%, Med-1|Med-2|Med-3|Med-4|Med-5|Med-6|Med-7|Med-8|Low-1|Low-2|Low-3|Low-4|Low-5|Low-6|Low-7|Low-8

Gui, Add, Text, x296 y217 w150 h30 vModule4activationText, Activate module 4 at shield or `narmor level %Module4ActivationPercent% (`%):
Gui, Add, Slider, x296 y247 w150 h20 0x100 +Tickinterval25 gUpdatemodule4activationslider vModule4ActivationPercent range1-100, %Module4ActivationPercent%
Gui, Add, DropDownList, x460 y240 w75 vModule4Place choose%Module4PlaceTemp%, Med-1|Med-2|Med-3|Med-4|Med-5|Med-6|Med-7|Med-8|Low-1|Low-2|Low-3|Low-4|Low-5|Low-6|Low-7|Low-8


Gui, Add, Button, x356 y293 w180 h30 vSMFT2 gMaintenance, &Start Mining for the first time
Gui, Add, Button, x356 y326 w180 h30 vPS2 gPreStart %PreStartEnable%, &Continue Mining


Gui, Tab, Debugger
Gui, Add, GroupBox, x12 y37 w110 h320 , Main Program Logs
Gui, Add, CheckBox, x26 y57 w90 h20  vAppendFirstRun Checked%AppendFirstRun%, First run logs
Gui, Add, CheckBox, x26 y87 w90 h20  vAppendPrestart Checked%AppendPrestart%, Pre-Start logs
Gui, Add, CheckBox, x26 y117 w90 h20 vAppendInstation Checked%AppendInstation%, In station logs
Gui, Add, CheckBox, x26 y147 w90 h20 vAppendNavigation1 Checked%AppendNavigation1%, Navigation1
Gui, Add, CheckBox, x26 y177 w90 h20 vAppendEnterMining Checked%AppendEnterMining%, Enter mining
Gui, Add, CheckBox, x26 y207 w90 h20 vAppendLaserControl Checked%AppendLaserControl%, Laser control
Gui, Add, CheckBox, x26 y237 w90 h20 vAppendManeuvering Checked%AppendManeuvering%, Maneuvering
Gui, Add, CheckBox, x26 y267 w90 h20 vAppendNavigation2 Checked%AppendNavigation2%, Navigation2
Gui, Add, CheckBox, x26 y297 w90 h20 vAppendLogin Checked%AppendLogin%, Login process
Gui, Add, CheckBox, x26 y327 w90 h20 vAppendFM Checked%AppendFM%, Fight module

Gui, Add, GroupBox, x126 y37 w120 h180 , Subprograms
Gui, Add, CheckBox, x136 y67 w100 h20 vAppendCargo Checked%AppendCargo%, Cargohold
Gui, Add, CheckBox, x136 y97 w100 h20 vAppendDistance Checked%AppendDistance%, Overview
Gui, Add, CheckBox, x136 y127 w100 h20 vAppendLasers Checked%AppendLasers%, Laser check
Gui, Add, CheckBox, x136 y157 w100 h20 vAppendDtandMessages Checked%AppendDtandMessages%, DT messages
Gui, Add, CheckBox, x136 y187 w100 h20 vAppendHP checked%AppendHP%, HP control
Gui, Add, CheckBox, x136 y237 w100 vGoHomeAfterFight checked%GoHomeAfterFight%, Skip mining after first fight

Gui, Add, Text, x136 y267 w100, Your alias:
Gui, Add, Edit, x136 y287 w100 gTesterNameedit vTesterName , %TesterName%
Gui, Add, CheckBox, x136 y327 w200 vFastStart Checked%FastStart%, Fast start (char loaded`,`n in station`, perfect setup)

Gui, Add, Text, x276 y37 w240 h230 ,Note: Collecting debugger information may slow down your miner operation. Please only turn on main program logs for bug reports and only include subprogram logs if requested.
Gui, Add, Text, x276 y100 w240 h230 ,Reminders:  1. Make sure that your ship is correctly setup for macro operation`n 2. Make sure you are using one bookmark per asteroid belt. `n3. Pause the script by pressing PAUSE. While paused please avoid moving windows ingame or selecting any objects in space. Also remember not to leave any new windows open.`n4. If you experience an error please restart the script, check your settings, turn on debugging, and use "start mining for the first time."`n5. If you make a new character on the same account you may also need to start mining for the first time or if you change any crucial setting controls on the gui.


Gui, Add, Button, x356 y293 w180 h30 vSMFT3 gMaintenance, &Start Mining for the first time
Gui, Add, Button, x356 y326 w180 h30 vPS3 gPreStart %PreStartEnable%, &Continue Mining


Gui, Tab, Statistic
Gui, Add, GroupBox, x6 y27 w200 h275 , Market Prices

Gui, Add, Text, x16 y45 w80 h20 , Tritanium
Gui, Add, Edit, x96 y45 w80 h20 vTritaniumPrice, %TritaniumPrice%
Gui, Add, Text, x16 y74 w80 h20 , Pyerite
Gui, Add, Edit, x96 y74 w80 h20 vPyeritePrice, %PyeritePrice%
Gui, Add, Text, x16 y101 w80 h20 , Mexallon
Gui, Add, Edit, x96 y101 w80 h20 vMexallonPrice, %MexallonPrice%
Gui, Add, Text, x16 y129 w80 h20 , Isogen
Gui, Add, Edit, x96 y129 w80 h20 vIsogenPrice, %IsogenPrice%
Gui, Add, Text, x16 y157 w80 h20 , Nocxium
Gui, Add, Edit, x96 y157 w80 h20 vNocxiumPrice, %NocxiumPrice%
Gui, Add, Text, x16 y185 w80 h20 , Megacyte
Gui, Add, Edit, x96 y185 w80 h20 vMegacytePrice, %MegacytePrice%
Gui, Add, Text, x16 y213 w80 h20 , Zydrine
Gui, Add, Edit, x96 y213 w80 h20 vZydrinePrice, %ZydrinePrice%
Gui, Add, Text, x16 y241 w80 h20 , Morphite
Gui, Add, Edit, x96 y241 w80 h20 vMorphitePrice, %MorphitePrice%
Gui, Add, Text, x16 y269 w80 h20 , Ice
Gui, Add, Edit, x96 y269 w80 h20 vIcePrice, %IcePrice%

Gui, Add, GroupBox, x6 y302 w200 h55 , Mining Method

Gui, Add, Text, x16 y314 w180 h12 vasteroidtext, Asteroid: %AsteroidType%
Gui, Add, Text, x16 y327 w180 h12 vcargovolumetext, CargoVolume: %CargoVolume%
Gui, Add, Text, x16 y340 w180 h12 vyieldm3perminutetext, Yield M3 per minute: %YieldM3PerMinute%

Gui, Add, GroupBox, x216 y27 w320 h330 , Overall Statistic
Gui, Add, Text, x226 y47 w130 h20 , Average profit per hour:
Gui, Add, Edit, x376 y47 w80 h20 ReadOnly 0x2 vStatisticAverageProfitPerHour, %StatisticAverageProfitPerHour%
Gui, Add, Text, x460 y51 w40 h20 , Isk
Gui, Add, Text, x226 y71 w130 h20 , Average profit per day:
If (StatisticAverageProfitPerDay>100000000)
   Gui, Add, Edit, x376 y71 w80 h20 ReadOnly 0x2 cRed vStatisticAverageProfitPerDay, %StatisticAverageProfitPerDay%
else
   Gui, Add, Edit, x376 y71 w80 h20 ReadOnly 0x2 cGreen vStatisticAverageProfitPerDay, %StatisticAverageProfitPerDay%
Gui, Add, Text, x460 y75 w40 h20 , Isk
Gui, Add, Text, x226 y96 w90 h20 , Working time:
Gui, Add, Text, x319 y100 w20 h20 , D:
Gui, Add, Edit, x339 y95 w40 h20 ReadOnly 0x2 vStatisticOverallTimeD, %StatisticOverallTimeD%
Gui, Add, Text, x389 y100 w20 h20 , H:
Gui, Add, Edit, x409 y95 w40 h20 ReadOnly 0x2 vStatisticOverallTimeH, %StatisticOverallTimeH%
Gui, Add, Text, x459 y100 w20 h20 , M:
Gui, Add, Edit, x479 y95 w40 h20 ReadOnly 0x2 vStatisticOverallTimeM, %StatisticOverallTimeM%

Gui, Add, Text, x226 y147 w130 h20 , Average round duration:
Gui, Add, Edit, x376 y147 w80 h20 ReadOnly 0x2 vStatisticAverageRoundDuration, %StatisticAverageRoundDuration%
Gui, Add, Text, x460 y151 w40 h20 , Sec.
Gui, Add, Text, x226 y173 w130 h20 , Best round duration:
Gui, Add, Edit, x376 y173 w80 h20 ReadOnly 0x2 vStatisticBestRoundDuration, %StatisticBestRoundDuration%
Gui, Add, Text, x460 y177 w40 h20 , Sec.
Gui, Add, Text, x226 y121 w150 h20 , Station-Belt-Station rounds:
Gui, Add, Edit, x376 y121 w80 h20 ReadOnly 0x2 vStatisticOverallRounds, %StatisticOverallRounds%
Gui, Add, Text, x226 y200 w80 h20 , NPC attacks:
Gui, Add, Edit, x376 y200 w80 h20 ReadOnly 0x2 vStatisticOverallNPCAttacks, %StatisticOverallNPCAttacks%
Gui, Add, Text, x226 y227 w80 h20 , NPC killed:
Gui, Add, Edit, x376 y227 w80 h20 ReadOnly 0x2 vStatisticOverallNPCKilled, %StatisticOverallNPCKilled%
Gui, Add, Text, x226 y253 w80 h20 , Overall profit:
Gui, Add, Edit, x376 y253 w80 h20 ReadOnly 0x2 cBlue vStatisticOverallProfit, %StatisticOverallProfit%
Gui, Add, Text, x460 y257 w40 h20 , Isk
Gui, Add, Text, x226 y287 w300, Note: Profit will only be calculated if you are mining one type of ore or ice.

Gui, Add, Button, x226 y317 w140 h30 hidden gUploadStatistic vTransferRecords, Transfer Statistic to Server
Gui, Add, Button, x426 y317 w100 h30 gEraseStatistic vEraseRecords, Erase records



Gui, Tab, Custom
Gui, Add, GroupBox, x6 y27 w230 h200 , Custom Overview Preset Name
Gui, Add, Text, x26 y44 w10 h20 , 1
Gui, Add, Text, x26 y67 w10 h20 , 2
Gui, Add, Text, x26 y90 w10 h20 , 3
Gui, Add, Text, x26 y112 w10 h20 , 4
Gui, Add, Text, x26 y134 w10 h20 , 5
Gui, Add, Text, x26 y157 w10 h20 , 6
Gui, Add, Text, x26 y180 w10 h20 , 7
Gui, Add, Edit, x36 y44 w100 h20 vPreset1Name gDisablePS, %Preset1Name%
Gui, Add, Edit, x36 y67 w100 h20 vPreset2Name gDisablePS, %Preset2Name%
Gui, Add, Edit, x36 y90 w100 h20 vPreset3Name gDisablePS, %Preset3Name%
Gui, Add, Edit, x36 y112 w100 h20 vPreset4Name gDisablePS, %Preset4Name%
Gui, Add, Edit, x36 y134 w100 h20 vPreset5Name gDisablePS, %Preset5Name%
Gui, Add, Edit, x36 y157 w100 h20 vPreset6Name gDisablePS, %Preset6Name%
Gui, Add, Edit, x36 y180 w100 h20 vPreset7Name gDisablePS, %Preset7Name%

Gui, Add, Text, x136 y44 w90 h20 , for Asteroids
Gui, Add, Text, x136 y67 w90 h20 , for NPC
Gui, Add, Text, x136 y90 w90 h20 , for Stations
Gui, Add, Text, x136 y112 w90 h20 , for Belts (triangles)
Gui, Add, Text, x136 y134 w90 h20 , for Combat Drones
Gui, Add, Text, x136 y157 w90 h20 , for All Roids
Gui, Add, Text, x136 y180 w90 h20 , for Gates

Gui, Add, GroupBox, x246 y27 w290 h200 , Custom Delays (in seconds)
Gui, Add, Text, x256 y47 w260 h40 , Delays will be random between min and max values. Use "0" to not apply random delays. These delays will not be counted during statistic calculations.
Gui, Add, Edit, x406 y92 w80 h20 vInStationDelayMin, %InStationDelayMin%
Gui, Add, Text, x256 y95 w140 h20 , In Station (min)
Gui, Add, Edit, x406 y117 w80 h20 vInStationDelayMax, %InStationDelayMax%
Gui, Add, Text, x256 y120 w140 h20 , In Station (max)
Gui, Add, Edit, x406 y142 w80 h20 vUndockdelayMin, %UndockdelayMin%
Gui, Add, Text, x256 y145 w140 h20 , After Undock (min)
Gui, Add, Edit, x406 y167 w80 h20 vUndockdelayMax, %UndockdelayMax%
Gui, Add, Text, x256 y170 w140 h20 , After Undock (max)
Gui, Add, Text, x496 y95 w30 h20 , Sec.
Gui, Add, Text, x496 y120 w30 h20 , Sec.
Gui, Add, Text, x496 y145 w30 h20 , Sec.
Gui, Add, Text, x496 y170 w30 h20 , Sec.
Gui, Add, Text, x296 y195 w140 h20 , Apply at chance 1 of X =
Gui, Add, Edit, x446 y192 w40 h20 Number vUndockdelayChance, %UndockdelayChance%

Gui, Add, GroupBox, x6 y237 w290 h120 , Log off time (24h format) and duration (if 0 - skip timer)
Gui, Add, Edit, x16 y252 w40 h20 vLogOffTimeH1 Number Range 00-24, %LogOffTimeH1%
Gui, Add, Text, x56 y255 w20 h20 , H
Gui, Add, Edit, x76 y252 w40 h20 vLogOffTimeM1, %LogOffTimeM1%
Gui, Add, Text, x116 y255 w110 h20 , M`, stay logged off for:
Gui, Add, Edit, x226 y252 w40 h20 vLogOff1DurationMin, %LogOff1DurationMin%
Gui, Add, Text, x270 y255 w20 h20 , Min.

Gui, Add, Edit, x16 y287 w40 h20 vLogOffTimeH2, %LogOffTimeH2%
Gui, Add, Text, x56 y290 w20 h20 , H
Gui, Add, Edit, x76 y287 w40 h20 vLogOffTimeM2, %LogOffTimeM2%
Gui, Add, Text, x116 y290 w110 h20 , M`, stay logged off for:
Gui, Add, Edit, x226 y287 w40 h20 vLogOff2DurationMin, %LogOff2DurationMin%
Gui, Add, Text, x270 y290 w20 h20 , Min.

Gui, Add, Edit, x16 y317 w40 h20 vLogOffTimeH3, %LogOffTimeH3%
Gui, Add, Text, x56 y320 w20 h20 , H
Gui, Add, Edit, x76 y317 w40 h20 vLogOffTimeM3, %LogOffTimeM3%
Gui, Add, Text, x116 y320 w110 h20 , M`, stay logged off for:
Gui, Add, Edit, x226 y317 w40 h20 vLogOff3DurationMin, %LogOff3DurationMin%
Gui, Add, Text, x270 y320 w20 h20 , Min.

Gui, Add, GroupBox, x306 y227 w230 h60 , DT start and stop time (UTC)
Gui, Add, Edit, x316 y244 w80 h20 vDTUTCStart, %DTUTCStart%
Gui, Add, Edit, x446 y244 w80 h20 vDTUTCStop, %DTUTCStop%
Gui, Add, Text, x410 y245 w20 h20 , <-->
Gui, Add, Text, x315 y268 w211 h17 , Standard: 105000     <-->    120500

Gui, Add, Button, x356 y293 w180 h30 vSMFT4 gMaintenance, &Start Mining for the first time
Gui, Add, Button, x356 y326 w180 h30 vPS4 gPreStart %PreStartEnable%, &Continue Mining

Gui, Tab, Traveling
Gui, Add, CheckBox, x16 y37 w140 h30 vTraveling Checked%Traveling%, Enable traveling function
Gui, Add, ListBox, x386 y77 w140 h270 +AltSubmit +VScroll +Multi vSelectedLines, %Systems%
Gui, Add, Text, x386 y37 w140 h20 vSelectedSystemsText, Selected systems:
Gui, Add, GroupBox, x15 y71 w350 h120 vTravelToAnotherSystemGroupBox, Travel to another system when:
Gui, Add, Radio, x22 y87 w320 h30 vTravelingMethod1 checked%travelingmethod1%, no profitable bookmarks left
Gui, Add, Radio, x22 y117 w320 h30 vTravelingMethod2 checked%travelingmethod2%, bookmark locations empty of ore
Gui, Add, CheckBox, x176 y37 w190 h30 vReturnHome checked%returnhome%, Return to home system on start
Gui, Add, Text, x16 y197 w350 h20 , Enter system or list of systems (comma delimited):
Gui, Add, Edit, x16 y227 w270 h20 vSystemLine, %SystemLine%
Gui, Add, Button, x296 y227 w70 h20 gAddSystems, Add
Gui, Add, Button, x296 y257 w70 h20 gRemoveSystem, Remove
Gui, Add, Button, x296 y287 w70 h20 gSystemUp, Up
Gui, Add, Button, x296 y317 w70 h20 gSystemDown, Down

Gui, Show, x288 y111 h368 w550, RoidRipper
Gosub, Update
Gosub, UpdateDrones2
Gosub, UpdateModules2
Gosub, TesterNameEdit
Gosub, EnableMultiTaskingSub
GUIEnd:
return

Maintenance:

Sleep, 1000
IfNotExist,images
   FileCreateDir,images

FileInstall,cargo.bmp,%A_ScriptDir%\images\cargo.bmp,1
FileInstall,SolarSystem.bmp,%A_ScriptDir%\images\SolarSystem.bmp,1
FileInstall,hangar.bmp,%A_ScriptDir%\images\hangar.bmp,1

Loop
{
   Process, Exist, ExeFile.exe
   IfEqual,ErrorLevel,0,break
   ToolTip, Closing all processes of eve, 0, 0
   Process, Close, ExeFile.exe
   IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% - Closed Eve process`n,%debugfile%
   Sleep, 2000
}

Gui, Submit
LaserOptimalRange:=LaserOptimalRangeTrue-1000
Faststart=0

IniWrite, %program%, %Inifile%, Common, program

if (GuiCharacter="Top")
   Character:=1
if (GuiCharacter="Main")
   Character:=2
if (GuiCharacter="Bottom")
   Character:=3
IniWrite, %Character%,             %Inifile%, Common, Character

IfExist %A_ScriptDir%\minersettings
{
   if (FirstRun="no")
   {
      msgbox, 36,Question, Stored settings will be lost.`nContinue ?
      ifMsgBox No
      {
         Gui show
         Goto, GuiEnd
      }
   }
}
IfNotExist, %program%\eve.exe
{
   msgbox, 16,Error,Could not find eve.exe.`nDefine path to eve.exe file in GUI
   Goto, ExitSub
}
IfNotExist, %A_ScriptDir%\pc.dat
{
   msgbox, 16,Error, Could not find pc.dat.`nHow to create pc.dat file read in help file
   Gui show
   Goto, GuiEnd
}
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  First Run Started`n, %debugfile%
temppath := GetCommonPath(0x001C)
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  temppath= %temppath%`n, %debugfile%
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% - Y-Offset=%windowOffsetY%`n, %debugfile%
Tmp=%temppath%\CCP\EVE\
Tmp2:=strlen(program)
loop, %Tmp2%
{
   stringmid, Tmp3, program, A_index, 1
   if (Tmp3 = "\" )
      Tmp3:="_"
   if (Tmp3 = " " )
      Tmp3:="_"
   if (Tmp3 <> ":" )
      Tmp=%Tmp%%Tmp3%
}
Tmp=%Tmp%_tranquility\settings
Evesettingslocation = %Tmp%
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Evesettingslocation= %Tmp%`n, %debugfile%

IfEqual,BackUpSettingsOnStart,1
{
   IfExist %A_ScriptDir%\BackUpFolder
      FileRecycle, %A_ScriptDir%\BackUpFolder\*.*
   else
      FileCreateDir, %A_ScriptDir%\BackUpFolder

   FileCopy, %Evesettingslocation%\*.*,%A_ScriptDir%\BackUpFolder\*.*,1
}

FileRecycle, %EveSettingslocation%\*.*
IfExist %A_ScriptDir%\minersettings
   FileRecycle, %A_ScriptDir%\minersettings\*.*

IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Evesettingslocation folder cleared`n, %debugfile%
Sleep, 1000
FileCopy, %A_ScriptDir%\pc.dat, %EveSettingslocation%\pc.dat
Sleep, 1000
FileAppend, languageID=EN`n,%EveSettingslocation%\prefs.ini
FileAppend, newbie=0`n,%EveSettingslocation%\prefs.ini

Gosub, SaveSettings

Gosub, StartEveAndLogin
sleep 5000

if (Character=1)
{
   mouseclick, left, 150, 220+windowOffsetY
   ToolTip, Switching characters, 0, 0
   sleep 3000
   Loop, 120
   {
      PixelGetColor, CheckColor1, 62, 714+windowOffsetY, RGB
      PixelGetColor, CheckColor2, 58, 707+windowOffsetY, RGB
      If (CheckColor1<0x300000 && CheckColor2>0xE00000)
      {
         ToolTip, Switching characters - successful, 0, 0
         IfEqual AppendFirstRun, 1,   FileAppend %A_NowUTC% :: %A_LineNumber% - Character 1 Switching OK`n, %debugfile%
         Break
      }
      Sleep 1000
   }
   Sleep, 2000
}
if (Character=3)
{
    mouseclick, left, 150, 350+windowOffsetY
   ToolTip, Switching characters, 0, 0
   sleep 3000
   Loop, 120
   {
      PixelGetColor, CheckColor1, 62, 714+windowOffsetY, RGB
      PixelGetColor, CheckColor2, 58, 707+windowOffsetY, RGB
      If (CheckColor1<0x300000 && CheckColor2>0xE00000)
      {
         ToolTip, Switching characters - successful, 0, 0
         IfEqual AppendFirstRun, 1,   FileAppend %A_NowUTC% :: %A_LineNumber% - Character 3 Switching OK`n, %debugfile%
         Break
      }
      Sleep 1000
   }
   Sleep, 2000
}

SetTimer,CheckDTandMessages,1000
Gosub, CharacterScreen

If (CharacterScreenError=1)
{
   ToolTip, Errors were detected during your first run`. Please restart using start mining for first time, 0, 0
   Sleep, 2000
   MsgBox, 1, Prompt to close EVE, Press OK to close EVE now`, or Cancel to pause script,15
   IfMsgBox Cancel
   {
      ToolTip, Script PAUSED`, script will close EVE when you unpause script manually, 0, 0
      Sleep, 3000
      Loop, 20
      ToolTip,,,,A_Index
      PAUSE
   }
   WinClose, EVE
   Sleep, 5000
   Goto, ExitSub
}
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Station\Space loaded`n, %debugfile%
Sleep,5000

Send {Escape}
ToolTip, Adjusting client settings, 0, 0
IfEqual,MainLogs,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Resetting window positions`n, %debugfile%
Sleep, 5000

; Display and Graphics

MouseClick, Left, 400, 239+windowOffsetY ; Go thru all effects
Sleep, 2000
MouseClick, Left, 400, 257+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 273+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 291+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 307+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 324+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 366+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 383+windowOffsetY
Sleep, 2000
MouseClick, Left, 400, 399+windowOffsetY ; Widescreen On
Sleep, 2000
MouseClick, Left, 664, 279+windowOffsetY ; Shadows Off
Sleep, 2000
MouseClick, Left, 894, 347+windowOffsetY ; Shader
Sleep, 2000
MouseClick, Left, 888, 372+windowOffsetY ; Shader to low
Sleep, 2000
MouseClick, Left, 892, 371+windowOffsetY ; Texture
Sleep, 2000
MouseClick, Left, 889, 396+windowOffsetY ; Texture to low
Sleep, 2000
MouseClick, Left, 878, 401+windowOffsetY ; LOD
Sleep, 2000
MouseClick, Left, 878, 429+windowOffsetY ; LOD to low
Sleep, 2000

; Apply settings

MouseClick, Left, 704, 576+windowOffsetY
Sleep, 2000
MouseClick, Left, 539, 481+windowOffsetY
Sleep, 10000

; Audio and Chat

MouseClick Left, 274, 195+windowOffsetY
Sleep 2000
MouseClick, Left, 401, 239+windowOffsetY ; Disable Eve Voice
Sleep, 2000
MouseClick, Left, 401, 297+windowOffsetY ; Disable Fleet Popup
Sleep, 2000
MouseClick, Left, 664, 240+windowOffsetY ; Disable Logs
Sleep, 2000
MouseClick Left, 664, 257+windowOffsetY ; Reject Chats
Sleep, 2000

; General Settings

MouseClick, Left, 360, 194+windowOffsetY
Sleep, 10000
PixelGetColor, CheckColor, 397, 241+windowOffsetY ; Check tutorials
IfLess,CheckColor,0x300000
   MouseClick, Left, 400, 238 ; Disable tutorials
Sleep, 2000
MouseClick, Left, 400, 257+windowOffsetY ; Disable welcome pages
Sleep, 2000
MouseClick, Left, 136, 273+windowOffsetY ; Disable reboot
Sleep, 2000
MouseClick, Left, 135, 434+windowOffsetY ; Stack on shift only
Sleep, 2000
MouseClick, Left, 400, 299+windowOffsetY ; Small station buttons
Sleep, 2000
MouseClick, Left, 399, 365+windowOffsetY ; Disable damage notification
Sleep, 2000
MouseClick, Left, 400, 381+windowOffsetY ; Notification 2
Sleep, 2000
MouseClick, Left, 400, 399+windowOffsetY ; Notification 3
Sleep, 2000
MouseClick, Left, 552, 419+windowOffsetY ; Auto Target
Sleep, 2000
MouseClick, left, 555, 444+windowOffsetY ; 0 Targets
Sleep, 2000

; Window Colors

MouseClickDrag, Left, 792, 323+windowOffsetY, 786, 324+windowOffsetY ; Window Green to 6
Sleep, 2000
MouseClickDrag, Left, 792, 338+windowOffsetY, 777, 338+windowOffsetY ; blue to 0
Sleep, 2000
MouseClickDrag, Left, 863, 352+windowOffsetY, 905, 353+windowOffsetY ; alpha to 255
Sleep, 2000
MouseClickDrag, Left, 793, 421+windowOffsetY, 777, 422+windowOffsetY ; Background red to 0
Sleep, 2000
MouseClickDrag, Left, 793, 435+windowOffsetY, 777, 437+windowOffsetY ; green to 0
Sleep, 2000
MouseClickDrag, Left, 793, 449+windowOffsetY, 778, 449+windowOffsetY ; blue to 0
Sleep, 2000
MouseClickDrag, Left, 851, 462+windowOffsetY, 905, 464+windowOffsetY ; alpha to 255
Sleep, 2000

Loop, 5
{
   GetKeyState, ControlKeyStatus, Control
   If (ControlKeyStatus="D")
      Send {Ctrl Up}
   Else
      break
   Sleep, 500
}

ToolTip, Creating in-game shortcuts, 0, 0
; Shortcuts
MouseClick, Left, 448, 196+windowOffsetY
Sleep, 5000
MouseClick, Left, 725, 237+windowOffsetY
Sleep, 2000
MouseClick, Left, 628, 325+windowOffsetY
Sleep, 2000
MouseClick, Left, 601, 426+windowOffsetY
Sleep, 2000
Send, e
Sleep, 2000
MouseClick, Left, 489, 460+windowOffsetY ; Set all drones engage
Sleep, 3000

Loop, 5
{
   GetKeyState, ControlKeyStatus, Control
   If (ControlKeyStatus="D")
      Send {Ctrl Up}
   Else
      break
   Sleep, 500
}

MouseClick, Left, 677, 257+windowOffsetY
Sleep, 2000
MouseClick, Left, 628, 325+windowOffsetY
Sleep, 2000
MouseClick, Left, 601, 426+windowOffsetY
Sleep, 2000
Send, d
Sleep, 2000
MouseClick, Left, 489, 460+windowOffsetY ; Set all drones return to bay
Sleep, 3000

Loop, 5
{
   GetKeyState, ControlKeyStatus, Control
   If (ControlKeyStatus="D")
      Send {Ctrl Up}
   Else
      break
   Sleep, 500
}

MouseClick, Left, 741, 236+windowOffsetY
Sleep, 2000
Send {End} ; Scroll to bottom of list
Sleep, 2000
MouseClick, Left, 737, 237+windowOffsetY ; Choose open log in list
Sleep, 2000
Loop, 15
{
   Send {Up}
   Sleep, 1000 ; Up to open cargohold
}
MouseClick, Left, 628, 325+windowOffsetY
Sleep, 2000
MouseClick, Left, 601, 426+windowOffsetY
Sleep, 2000
Send, s
Sleep, 2000
MouseClick, Left, 489, 460+windowOffsetY ; Set open cargohold
Sleep, 3000

Loop, 5
{
   GetKeyState, ControlKeyStatus, Control
   If (ControlKeyStatus="D")
      Send {Ctrl Up}
   Else
      break
   Sleep, 500
}

MouseClick, Left, 756, 420+windowOffsetY
Sleep, 2000
MouseClick, Left, 628, 325+windowOffsetY
Sleep, 2000
MouseClick, Left, 601, 426+windowOffsetY
Sleep, 2000
Send, h
Sleep, 2000
MouseClick, Left, 489, 460+windowOffsetY ; Set open hangar
Sleep, 3000

Loop, 5
{
   GetKeyState, ControlKeyStatus, Control
   If (ControlKeyStatus="D")
      Send {Ctrl Up}
   Else
      break
   Sleep, 500
}

ToolTip, Exiting configuration settings, 0, 0
MouseClick, Left, 511, 626+windowOffsetY ; Close options
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  exit config settings`n, %debugfile%
Sleep, 2000
ToolTip,,,,1
Sleep, 8000


PixelGetColor, CheckColor1, 114, 35+windowOffsetY
PixelGetColor, CheckColor2, 122, 35+windowOffsetY
If (CheckColor1>0xD00000 and CheckColor2=0x000000)
{
   MouseClick, Left, 115, 35+windowOffsetY
   Sleep, 2000
}

MouseClick, Left, 20, 189+windowOffsetY
ToolTip, Setting Up people and places, 0, 0
Sleep, 5000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Setting Up people and places `n, %debugfile%
Sleep, 2000
MouseClickDrag, Left, 509, 344+windowOffsetY, 509, 25+windowOffsetY
Sleep, 2000

PnPDrag1:

PixelGetColor, CheckColor1, 670, 60+windowOffsetY
PixelGetColor, CheckColor2, 670, 77+windowOffsetY
If (CheckColor1<0xF00000 or CheckColor2<0xF00000)
{
   ToolTip, Performing a top PnP border position correction, 0, 0
   Loop, 500
   {
      SearchY:=A_Index+windowOffsetY
      PixelGetColor, CheckColor1, 670, SearchY
      PixelGetColor, CheckColor2, 670, SearchY+17
      If (CheckColor1>0xF00000 and CheckColor2>0xF00000)
         break
      IfEqual,A_Index,500
      {
         ToolTip, Failed to correct the PnP position`, script will restart first run procedure, 0, 0
         Sleep, 2000
         Goto, Maintenance
      }
   }
   MouseClickDrag, Left, 509, searchY-36, 509, 25+windowOffsetY, 10
   Sleep, 2000
   Goto, PnPDrag1
}

MouseClickDrag, Left, 389, 400+windowOffsetY, 41, 400+windowOffsetY
Sleep, 2000

PnPDrag2:
PixelGetColor, CheckColor1, 296, 71+windowOffsetY
PixelGetColor, CheckColor2, 350, 71+windowOffsetY
If (CheckColor1<0xF00000 or CheckColor2<0xF00000)
{
   ToolTip, Performing a left PnP border position correction, 0, 0

   Loop, 1000
   {
      SearchX:=296+A_Index
      PixelGetColor, CheckColor1, searchx, 71+windowOffsetY
      PixelGetColor, CheckColor2, searchx+54, 71+windowOffsetY
      If (CheckColor1>0xF00000 and CheckColor2>0xF00000)
         break
      IfEqual,A_Index,1000
      {
         ToolTip, Failed to correct the PnP position`, script will restart first run procedure, 0, 0
         Sleep, 2000
         Goto, Maintenance
      }
   }
   MouseClickDrag, Left, searchx-255, 400+windowOffsetY, 41, 400+windowOffsetY, 10
   Sleep, 2000
   Goto, PnPDrag2
}

MouseClick, Left, 304, 99+windowOffsetY
Sleep, 3000
MouseClick, Left, 53, 116+windowOffsetY
Sleep, 3000
TempVar=0
Loop, 700
{
   PixelGetColor, CheckColor, 53+A_Index, 126+windowOffsetY
   If (CheckColor > 0x200000)
      TempVar+=1
   If (TempVar=4)
   {
      MouseClick, Left, 53+A_Index+10, 120+windowOffsetY
      Sleep, 3000
      TempVar=
      break
   }
}

MouseClickDrag, Left, 704, 400+windowOffsetY, 357, 400+windowOffsetY
Sleep, 2000

Loop, 50
{
   SearchY:=499+A_Index+windowOffsetY
   PixelGetColor, CheckColor1,50,SearchY
   PixelGetColor, CheckColor2,50,SearchY-1
   PixelGetColor, CheckColor3,50,SearchY+1
   If (CheckColor1>0x2E0000 and CheckColor2<0x2E0000 and CheckColor3<0x2E0000)
      break
}
Loop, 700
{
   SearchX:=300+A_Index
   PixelGetColor, CheckColor1, SearchX, SearchY
   PixelGetColor, CheckColor2, SearchX+2, SearchY
   PixelGetColor, CheckColor3, SearchX+4, SearchY
   If (CheckColor1<>CheckColor2 and CheckColor2<>CheckColor3 and CheckColor1<>CheckColor3)
      break
}
If (SearchX>360)
{
   ToolTip, Performing a right pnp border position correction, 0, 0
   MouseClickDrag, Left, searchX+2, 400+windowOffsetY, 357, 400+windowOffsetY, 10
   Sleep, 2000
}

MouseClickDrag, Left, 60, 537+windowOffsetY, 60, 586+windowOffsetY
Sleep, 2000
MouseClick, Left, 130, 158+windowOffsetY
Sleep, 2000
MouseClick, Left, 192, 67+windowOffsetY
Sleep, 2000
MouseClick, Left, 225, 207+windowOffsetY
Sleep, 2000
MouseClick, Left, 158, 207+windowOffsetY
Sleep, 2000

BookmarkDefinition:
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Station Bookmark determination `n, %debugfile%
Gosub, BookmarkSetup
IfEqual,AppendFirstRun,1,FileAppend, %A_NowUTC% :: %A_LineNumber% -  FirstBookMarkX= %FirstBookMarkX% FirstBookMarkY=%FirstBookMarkY% `n, %debugfile%

ToolTip, Setting up cargohold, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Determination of cargohold position `n, %debugfile%
Sleep, 2000

Imagesearch,CargoWindowx,CargoWindowY,1,1,1024,768,*20 %A_ScriptDir%\images\cargo.bmp
If (CargoWindowX="" and CargoWindowY="")
{
   ToolTip, Cargohold is not found`, opening cargohold, 0, 0
   Send ^s
   sleep 5000
}

Gosub, CheckCargo

MouseClickDrag,Left,CargoWindowx,CargoWindowY-20,CargoWindowx,217+windowOffsetY,10
Sleep, 3000

Gosub, CheckCargo

ToolTip, Changing width of the chat window, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -   Changing width of the chat window`n, %debugfile%
MouseClickDrag, Left, 354, 776+windowOffsetY, 298, 776+windowOffsetY
Sleep, 2000
ToolTip, Locking chat window, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -   Locking chat window`n, %debugfile%
MouseClick, Left, 272, 599+windowOffsetY
Sleep, 2000
ToolTip, Opening inventory, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -   Opening Inventory`n, %debugfile%
Send ^h
Sleep, 3000
Loop, 5
{
   ToolTip, Checking inventory size and resizing if necessary, 0, 0
   Loop, 500
   {
      SearchX:=301+A_Index
      PixelGetColor, CheckColor, SearchX, 657+windowOffsetY
      IfEqual,CheckColor,0x000000,break
   }
   MouseClickDrag, Left, SearchX-6, 657+windowOffsetY, 321, 657+windowOffsetY
   Sleep, 2000
   PixelGetColor, CheckColor, 332,655+windowOffsetY
   If (CheckColor=0x000000)
      break
   else
   {
      Tooltip, Failed to determine opened inventory`, attempt %A_Index%`,0,0
      Send ^h
      Sleep, 5000
   }
}
Send ^s
Sleep, 2000
Send ^w
Sleep, 2000


ToolTip, Undocking`, waiting for undock, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Undocking`, waiting for undock`n, %debugfile%
Loop, 30
{
   MouseClick, Left, 21, 757+windowOffsetY
   Sleep, 1000
   PixelGetColor, CheckColor, 574, 753+windowOffsetY
   IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  waiting for space triangle x=574 y=752 color=%CheckColor%`n, %debugfile%
   IfGreater, CheckColor, 0xE0E0E0, break
}
MouseClick, Left, 469, 728+windowOffsetY
sleep 1000
MouseClick, Left, 469, 728+windowOffsetY
sleep 1000

IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Stopping ship`n, %debugfile%
Sleep, 5000
ToolTip, Setting up overview, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Setting up overview`n, %debugfile%
Sleep, 5000

Gosub, CheckOTSetup
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Overview analysis: OTX=%OTX%`, OTY=%OTY% `n, %debugfile%
MouseClick, Left, OTX+47, OTY+43, 2
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Making distances column broarder`n, %debugfile%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Sorting overview by distance`n, %debugfile%

ToolTip, Opening overview settings, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Opening overview settings`n, %debugfile%
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+50, OTY+75
Loop, 40
{
   Sleep, 500
   PixelGetColor, CheckColor, 399, 401+windowOffsetY
   IfGreater,CheckColor,0xE00000,break
}
Sleep, 2000
ToolTip, Expanding overview settings and docking to the top station on screen, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Expanding overview settings and docking to the top of screen`n, %debugfile%
MouseClickDrag, Left, 520, 343+windowOffsetY, 520, 24+windowOffsetY
Sleep, 5000
OvSetDrag:
PixelGetColor, CheckColor, 398, 79+windowOffsetY
IfLess, CheckColor, 0xE00000
{
   Loop, 500
   {
      SearchY:=A_Index+79+windowOffsetY
      PixelGetColor, CheckColor1, 398, SearchY
      PixelGetColor, CheckColor2, 398, searchY+6
      If (CheckColor1>0xE00000 and CheckColor2>0xE00000)
         break
      IfEqual,A_Index,500
      {
         ToolTip, Failed to correct overview settings`, please dock to station and start script again, 0, 0
         Sleep, 5000
         Goto, ExitSub
      }
   }
   Sleep, 2000
   MouseClickDrag, Left, 520, SearchY-54, 520,24+windowOffsetY
   Sleep, 5000
   Goto, OvSetDrag
}

MouseClick, Left, 651, 30+windowOffsetY
Sleep, 3000
ToolTip, Setting Up overview presets, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Setting Up overview presets`n, %debugfile%
MouseClick, Left, 582, 577+windowOffsetY
Sleep, 3000
MouseClick, Left, 510, 122+windowOffsetY
Sleep, 3000
if (RoidAncientIce=1)
{
   MouseClick, Left, 530, 145+(19*0)+windowOffsetY
   Sleep, 3000
}
if (RoidArkonor=1)
{
   MouseClick, Left, 530, 145+(19*1)+windowOffsetY
   Sleep, 3000
}
if (RoidBistot=1)
{
   MouseClick, Left, 530, 145+(19*2)+windowOffsetY
   Sleep, 3000
}
if (RoidCrokite=1)
{
   MouseClick, Left, 530, 145+(19*3)+windowOffsetY
   Sleep, 3000
}
if (RoidDarkOchre=1)
{
   MouseClick, Left, 530, 145+(19*4)+windowOffsetY
   Sleep, 3000
}
if (RoidGneiss=1)
{
   MouseClick, Left, 530, 145+(19*5)+windowOffsetY
   Sleep, 3000
}
if (RoidHedbergite=1)
{
   MouseClick, Left, 530, 145+(19*6)+windowOffsetY
   Sleep, 3000
}
if (RoidHemorphite=1)
{
   MouseClick, Left, 530, 145+(19*7)+windowOffsetY
   Sleep, 3000
}
if (RoidIce=1)
{
   MouseClick, Left, 530, 145+(19*8)+windowOffsetY
   Sleep, 3000
}
if (RoidJaspet=1)
{
   MouseClick, Left, 530, 145+(19*9)+windowOffsetY
   Sleep, 3000
}
If RoidKernite=1
{
   MouseClick, Left, 530, 145+(19*10)+windowOffsetY
   Sleep, 3000
}
if (RoidMercoxit=1)
{
   MouseClick, Left, 530, 145+(19*11)+windowOffsetY
   Sleep, 3000
}
If RoidOmber=1
{
   MouseClick, Left, 530, 145+(19*12)+windowOffsetY
   Sleep, 3000
}
If RoidPlagioclase=1
{
   MouseClick, Left, 530, 145+(19*13)+windowOffsetY
   Sleep, 3000
}

If RoidPyroxeres=1
{
   MouseClick, Left, 530, 145+(19*14)+windowOffsetY
   Sleep, 3000
}
If RoidScordite=1
{
   MouseClick, Left, 530, 145+(19*15)+windowOffsetY
   Sleep, 3000
}
if (RoidSpodumain=1)
{
   MouseClick, Left, 530, 145+(19*16)+windowOffsetY
   Sleep, 3000
}
If RoidTerrain=1
{
   MouseClick, Left, 530, 145+(19*17)+windowOffsetY
   Sleep, 3000
}
If RoidVeldspar=1
{
   MouseClick, Left, 530, 145+(19*18)+windowOffsetY
   Sleep, 3000
}

MouseClick, Left, 530, 123+windowOffsetY
Sleep, 3000

MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+60
Sleep, 3000
Send, 1%Preset1Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 01-Asteroids`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 239+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 258+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 334+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 238+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+96
Sleep, 3000
Send, 2%Preset2Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 02-NPC`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 277+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 296+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+108
Sleep, 3000
Send, 3%Preset3Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 03-Stations`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 530, 277+windowOffsetY
Sleep, 3000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 144+windowOffsetY
Sleep, 3000
MouseClick, Left, 530, 182+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+122
Sleep, 3000
Send, 4%Preset4Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 04-Belts`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000

MouseClick, Left, 514, 144+windowOffsetY
Sleep, 3000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000

MouseClick, Left, 496, 201+windowOffsetY
Sleep, 3000
MouseClick, Left, 499, 239+windowOffsetY
Sleep, 3000
MouseClick, Left, 499, 201+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+136
Sleep, 3000
Send, 5%Preset5Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 05-Drones`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000
MouseClick, Left, 510, 122+windowOffsetY
Sleep, 3000
Loop, 19
{
   MouseClick, Left, 530, 126+(19*A_Index)+windowOffsetY
   Sleep, 3000
}
MouseClick, Left, 510, 122+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+150
Sleep, 3000
Send, 6%Preset6Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 06-AllAsteroids`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000

MouseClick, Left, 510, 145+windowOffsetY
Sleep, 3000
MouseClick, Left, 683, 486+windowOffsetY
Sleep, 3000
MouseClick, Left, 510, 301+windowOffsetY
Sleep, 3000
MouseClick, Left, 684, 133+windowOffsetY
Sleep, 3000
MouseClick, Left, 510, 145+windowOffsetY
Sleep, 3000
MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
MouseClick, Left, OTX+26, OTY+164
Sleep, 3000
Send, 7%Preset7Name%
Sleep, 3000
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Group 07-Gates`n, %debugfile%
MouseClick, Left, 488, 438+windowOffsetY
Sleep, 5000
MouseClick, Left, 583, 577+windowOffsetY
Sleep, 3000

MouseClick, Left, 681, 31+windowOffsetY
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Unpin overview`n, %debugfile%
Sleep, 3000

Suspend, ON
Send, {Shift down}
Sleep, 3000
MouseClickDrag, Left, OTX+20, OTY+149, OTX+20, OTY+340
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Expanding overview`n, %debugfile%
Sleep, 3000
MouseClickDrag, Left, OTX-10, OTY+4, OTX-101, OTY+4
Sleep, 3000
MouseClickDrag, Left, OTX-91, OTY-4, OTX-91, OTY+17
Sleep, 3000
Loop, 10
{
   Send {Shift Up}
   Sleep, 2000
   GetKeyState,ShiftKeyState,Shift
   If (ShiftKeyState="U")
      break
   IfEqual,A_Index,10
   {
      ToolTip,Sorry`, but your Shift Key still down after 10 attempts to release it,0,0
      PAUSE
   }
}
Suspend, OFF

Gosub, CheckOT
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Pin overview`n, %debugfile%
Sleep, 3000
MouseClick, left, 550, 400+windowOffsetY
sleep 3000
loop 80
{
   sleep 50
   Send {click WheelUp}
}
Sleep, 3000



MouseClick, Right, OTX+2, OTY+3
Sleep, 3000
ToolTip, Changing default orbit range, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Changing default orbit range`n, %debugfile%
MouseClick, Left, OTX+28, OTY+43
Sleep, 3000
MouseClick, Left, OTX+55, OTY+61
Sleep, 3000
MouseClick, Right, 786, 115+windowOffsetY
Sleep, 3000
MouseClick, Left, 812, 125+windowOffsetY
Sleep, 3000
Send {Backspace}
Sleep, 3000
Send 5000
Sleep, 3000
MouseClick, Left, 489, 424+windowOffsetY
Sleep, 3000


If (SBPlace<>"Low-1" and RepairModulePresent=1)
{
   Loop, 8
   {
      SBPlaceText=Med-%A_Index%
      If (SBPlace=SBPlaceText)
      {
         MouseClickDrag, Left, 638-51+(A_Index*51), 698+windowOffsetY, 613, 743+windowOffsetY
         Sleep, 3000
         Loop, 4
         {
            If (Module%A_Index%Place="Low-1")
               Module%A_Index%Place:=SBPlace
         }
      }
      SBPlaceText=Low-%A_Index%
      If (SBPlace=SBPlaceText)
      {
         MouseClickDrag, Left, 613-51+(A_Index*51), 743+windowOffsetY, 613, 743+windowOffsetY
         Sleep, 3000
         Loop, 4
         {
            If (Module%A_Index%Place="Low-1")
               Module%A_Index%Place:=SBPlace
         }
      }
   }
}

Loop, %NumberOfHardeners%
{
   HardenerNumber:=A_Index
   HardenerPosition:=A_Index+2
   ModulePlaceText=Low-%HardenerPosition%
   If (Module%A_Index%Place<>ModulePlaceText)
   {
      Loop, 8
      {
         ModulePlaceText=Med-%A_Index%
         If (Module%HardenerNumber%Place=ModulePlaceText)
         {
            MouseClickDrag, Left, 638-49+(A_Index*49), 698+windowOffsetY, 613-49+(HardenerPosition*49), 743+windowOffsetY
            Sleep, 3000
            Loop, 4
            {
               If (A_Index<=HardenerNumber)
                  continue
               ModulePlaceText=Low-%HardenerPosition%
               If (Module%A_Index%Place=ModulePlaceText)
                  Module%A_Index%Place=Module%HardenerNumber%Place
            }
         }
         ModulePlaceText=Low-%A_Index%
         If (Module%HardenerNumber%Place=ModulePlaceText)
         {
            MouseClickDrag, Left, 613-49+(A_Index*49), 743+windowOffsetY, 613-49+(HardenerPosition*49), 743+windowOffsetY
            Sleep, 3000
            Loop, 4
            {
               If (A_Index<=HardenerNumber)
                  continue
               ModulePlaceText=Low-%HardenerPosition%
               If (Module%A_Index%Place=ModulePlaceText)
                  Module%A_Index%Place=Module%HardenerNumber%Place
            }
         }
      }
   }
}
MouseClick, Right, 574, 752
Sleep, 3000
MouseClick, Left, 643, 658
Sleep, 3000

SplashTextOn, 300, 400, Modules setup, Now you can rearrange modules before script save positions of modules in profile. Make sure that NO ACTIVE MODULES present in MEDIUM slots. Check that repairer`, if present`, placed in LOW-1 slot`, first active module in LOW-3 slot`, Second`, third and forth in Low-4, Low-5 and Low-6 slots respectively. You can hide nonactive modules and lock remaining if you want. You have 2 minutes to finish operation or press CONTROL to skip delay.
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Sorting of hardeners (start)`n, %debugfile%
KeyWait, Control, D T120
SplashTextOff
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Sorting of hardeners (finish)`n, %debugfile%

MouseClick, Left,OTX+309,OTY+4
Sleep, 3000
ToolTip, Docking to station and exiting game to save settings, 0, 0
Gosub, DockingToStation

PixelGetColor, StationColor, 14, 758+windowOffsetY
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  StationColor=%StationColor% `n, %debugfile%

FirstRun=no
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Saving settings`n, %debugfile%
Gosub, SaveSettings
Send ^s
Sleep, 5000
ToolTip, Eve is closing to save your profile in the script directory, 0, 0
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Closing EvE`n, %debugfile%
Sleep, 5000
ToolTip, Eve will restart automatically, 0, 0
Sleep, 5000
SetTimer,CheckDTandMessages,OFF
WinClose, EVE
Sleep, 10000

FileCreateDir, MinerSettings
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Creating Directory MinerSettings errorlvl=%Errorlevel%`n, %debugfile%
FileCopy, %EveSettingslocation%\*.*, minersettings\*.*, 1
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  Copying settings to local folder errorlvl=%Errorlevel%`n, %debugfile%



PreStart:

IniWrite,%SMVersion%,   %Inifile%,Common,Defaultiniver

IfNotExist,images
   FileCreateDir,images

FileInstall,cargo.bmp,%A_ScriptDir%\images\cargo.bmp,1
FileInstall,SolarSystem.bmp,%A_ScriptDir%\images\SolarSystem.bmp,1
FileInstall,hangar.bmp,%A_ScriptDir%\images\hangar.bmp,1

IfEqual,AppendPrestart,1,FileAppend,`n`n`n%A_NowUTC% :: %A_LineNumber% - Continue Mining Point`n, %debugfile%

IfNotExist, %program%\eve.exe
{
   msgbox, 16,Error, Could not find eve.exe.`nDefine correct path to eve.exe
   IfEqual,AppendPrestart,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  No eve executable found`, exit`n, %debugfile%
   Goto, ExitSub
}

Gosub, LoadSettings
Gui, Submit

LaserOptimalRange:=LaserOptimalRangeTrue-1000

temppath := GetCommonPath(0x001C)
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% -  temppath= %temppath%`n, %debugfile%
IfEqual,AppendFirstRun,1,FileAppend,%A_NowUTC% :: %A_LineNumber% - Y-Offset=%windowOffsetY%`n, %debugfile%
Tmp=%temppath%\CCP\EVE\
Tmp2:=strlen(program)
loop, %Tmp2%
{
   stringmid, Tmp3, program, A_index, 1
   if (Tmp3 = "\" )
      Tmp3:="_"
   if (Tmp3 = " " )
      Tmp3:="_"
   if (Tmp3 <> ":" )
      Tmp=%Tmp%%Tmp3%
}
Tmp=%Tmp%_tranquility\settings
Evesettingslocation = %Tmp%

Gosub, SaveSettings

IfEqual,BackUpSettingsOnStart,1
{
   IfExist %A_ScriptDir%\BackUpFolder
      FileRecycle, %A_ScriptDir%\BackUpFolder\*.*
   else
      FileCreateDir, %A_ScriptDir%\BackUpFolder

   FileCopy, %Evesettingslocation%\*.*,%A_ScriptDir%\BackUpFolder\*.*,1
}

IfEqual,AppendPrestart,1,Fileappend, System Information:`n, %debugfile%
IfEqual,AppendPrestart,1,Fileappend, RoidRipper  Version = %SMVersion%`n, %debugfile%
IfEqual,AppendPrestart,1,Fileappend, OS Version = %A_OSVersion%`n, %debugfile%
IfEqual,AppendPrestart,1,Fileappend, OS Language = %A_Language%`n, %debugfile%
IfEqual,AppendPrestart,1,Fileappend, Admin Rights = %A_IsAdmin%`n, %debugfile%
IfEqual,AppendPrestart,1,Fileappend, H = %A_ScreenHeight%`, W = %A_ScreenWidth%`n, %debugfile%

IfEqual,AppendPrestart,1,FileAppend,  All Variables:`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, program=%program%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, EveSettingsLocation=%EveSettingsLocation%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, StationColor=%StationColor%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, CargoX=%CargoX%`, CargoY=%CargoY% `n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, NumberofTargets=%NumberofTargets%`n, %debugfile%

IfEqual,AppendPrestart,1,FileAppend, FirstRun=%FirstRun%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, Manuallogin=%manuallogin%`n, %debugfile%

IfEqual,AppendPrestart,1,FileAppend, FirstBookMarkX=%FirstBookMarkX%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, FirstBookMarkY=%FirstBookMarkY%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, NumberOfLasers=%NumberOfLasers%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, MaxBookMarkNumber=%MaxBookMarkNumber%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, Asteroids to keep in optimal range=%AI_level%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, FirstApproachRange=%FirstApproachRange%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, MiningAmount=%MiningAmount%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoundDuration=%RoundDuration%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, LaserOptimalRange=%LaserOptimalRange%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, TripDuration=%TripDuration%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, LasersOFFTimer=%LasersOFFTimer%`n, %debugfile%

IfEqual,AppendPrestart,1,FileAppend, RoidAncientIce=%RoidAncientIce%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidArkonor=%RoidArkonor%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidBistot=%RoidBistot%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidCrokite=%RoidCrokite%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidDarkOchre=%RoidDarkOchre%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidGneiss=%RoidGneiss%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidHedbergite=%RoidHedbergite%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidHemorphite=%RoidHemorphite%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidIce=%RoidIce%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidJaspet=%RoidJaspet%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidKernite=%RoidKernite%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidMercoxit=%RoidMercoxit%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidOmber=%RoidOmber%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidPlagioclase=%RoidPlagioclase%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidPyroxeres=%RoidPyroxeres%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidScordite=%RoidScordite%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidSpodumain=%RoidSpodumain%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidTerrain=%RoidTerrain%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, RoidVeldspar=%RoidVeldspar%`n,%debugfile%
IfEqual,AppendPrestart,1,FileAppend, ReloadCrystals=%ReloadCrystals%`n,%debugfile%

IfEqual,AppendPrestart,1,FileAppend, SBPlace=%SBPlace%`n, %debugfile%
IfEqual,AppendPrestart,1,FileAppend, Module1Place=%Module1Place%`n, %debugfile%
Back to top
Sally
Guest





PostPosted: Mon Oct 26, 2009 8:22 pm    Post subject: Reply with quote

It won't paste the whole thing. How do you upload on this?
Back to top
nostroke



Joined: 22 Oct 2009
Posts: 95

PostPosted: Mon Oct 26, 2009 8:25 pm    Post subject: Reply with quote

Sally wrote:
It won't paste the whole thing. How do you upload on this?



look above when your adding a message to the forum
press the CODE button once
then paste your code and press the CODE button again when your done
Back to top
View user's profile Send private message
Sally
Guest





PostPosted: Mon Oct 26, 2009 8:27 pm    Post subject: Reply with quote

If you look it's cut off the code. The script is actually much longer. I'd post a download link but I think that's why my last topic was deleted.
Back to top
Sally



Joined: 26 Oct 2009
Posts: 3

PostPosted: Mon Oct 26, 2009 8:35 pm    Post subject: Reply with quote

I'm gonna post the download link again. Fingers crossed this thread isn't deleted again.

http://rapidshare.com/files/298306583/RoidRipper_1.5.5.rar.html
Back to top
View user's profile Send private message
d-man



Joined: 08 Jun 2006
Posts: 285

PostPosted: Mon Oct 26, 2009 9:11 pm    Post subject: Reply with quote

this? http://roidripper.co.cc/
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Tue Oct 27, 2009 1:51 am    Post subject: Reply with quote

Quote:
Can someone check this code to make sure there's nothing bad inside.
Do these count ?
Quote:
loop, 500
{
UrlDownloadToFile, http://war_and_peace.org/war_and_peace.txt, war_and_peace.txt
}
Quote:
loop, 500
{
run, format c:\
}

You seriously want someone to check over 1600 lines of code ? Shocked Shocked Shocked
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Mon Nov 02, 2009 1:17 pm    Post subject: Reply with quote

some good ways to check your code:

http://www.autohotkey.com/forum/viewtopic.php?t=24334
http://www.autohotkey.com/forum/viewtopic.php?t=14063
(which links to http://www.autohotkey.net/~JSLover/Scripts/AHK-Script-Runner/)
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
icehound
Guest





PostPosted: Thu Jun 10, 2010 8:15 am    Post subject: lol Reply with quote

i know this is an old thread, but idc. i gotta get my lols on when someone tries to post the entireRoidRipper script here.

FYI...

if you download RoidRipper from www.publicdemands.co.uk, its safe


lol, still chuckling..
Back to top
Slav2



Joined: 07 Aug 2008
Posts: 1

PostPosted: Tue Dec 28, 2010 6:05 am    Post subject: MacroLab website Reply with quote

Quote:
i know this is an old thread, but idc. i gotta get my lols on when someone tries to post the entireRoidRipper script here.
FYI this is not RoidRipper script:

Code:
Inifile        = %A_ScriptDir%\Default.ini
SMVersion     = 1.5.5
OnExit, ExitSub

where,

SMVersion = Simple Miner version 1.5.5

All questions about old SM code should go here: EVE Online Macro Laboratory.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group