{"commit":"670cdd6e0cf7d5ccbb77dddc78b96da94ffda873","subject":"Test are now working","message":"Test are now working\n","repos":"AutoItMicro\/MicroUnitTestingFramework","old_file":"tests\/suiteTest.au3","new_file":"tests\/suiteTest.au3","new_contents":"#Region include for test\n#include <..\/micro.au3>\n#EndRegion\n\n#Region Test suite definition\nLocal $testSuite = _testSuite_(\"Test Suite Test\")\n\n$testSuite.addTest(assertTruePass())\n\n$testSuite.finish()\n#EndRegion\n\n#Region Test Functions\nFunc assertTruePass()\n $test = _test_(\"assertTrue(true) returns pass\")\n\t$test.assertTrue(\"True\", True)\n Return $test\nEndFunc\nFunc assertTrueFail()\n $test = _test_(\"assertTrue(true) returns pass\")\n\t$test.assertTrue(\"False\", False)\n Return $test\nEndFunc\n\n#EndRegion\n","old_contents":"#AutoIt3Wrapper_UseX64=n\n\n#Region include for test\n#include <..\/micro.au3>\n#EndRegion\n\n#Region Test suite definition\nLocal $testSuite = _testSuite_(\"Test Suite Test\")\n\n$testSuite.addTest(assertTruePass())\n\n$testSuite.finish()\n#EndRegion\n\n#Region Test Functions\nFunc assertTruePass()\n $test = _test_(\"assertTrue(true) returns pass\")\n\t$test.assertTrue(\"True\", True)\n Return $test\nEndFunc\n#EndRegion\n","returncode":0,"stderr":"","license":"mit","lang":"AutoIt"} {"commit":"ec5d722c6d583a35fe4bf32e8c3be33ec7997bbd","subject":"Update Hour2Sec.au3","message":"Update Hour2Sec.au3\n\nConvert a time string to seconds.\r\nConverte uma string de tempo para segundos.\r\n\"02:30:00\" => 5400","repos":"chechelaky\/AutoIt,chechelaky\/AutoIt,chechelaky\/AutoIt,chechelaky\/AutoIt","old_file":"Hour2Sec.au3","new_file":"Hour2Sec.au3","new_contents":"; #FUNCTION# ====================================================================================================================\n; Name...........: Hour2Sec\n; Description ...: Convert a string with hour data in seconds hh[ :mm[ :ss]]\n; Syntax.........: Hour2Sec(2)\n;\t\t\t\t Hour2Sec(\"2:30\")\n;\t\t\t\t Hour2Sec(\"02:30:45\")\n; Parameters ....: $mInput\n; Return values .: Integer, number of seconds\n; Author ........: Luismar Chechelaky\n; Modified.......: 2015\/06\/10\n; Remarks .......:\n; Related .......:\n; Link ..........:\n; Example .......:\n; ===============================================================================================================================\nFunc Hour2Sec($mInput = 0)\n\t$mInput = StringSplit($mInput, \":\", 2)\n\tLocal $aNum[5] = [0, 3600, 0, 0, 0]\n\tFor $ii = 0 To 2\n\t\tIf $ii < UBound($mInput, 1) And $mInput[$ii] >= 0 Then $aNum[$ii + 2] = $mInput[$ii] * $aNum[1]\n\t\t$aNum[0] += $aNum[$ii + 2]\n\t\t$aNum[1] \/= 60\n\tNext\n\tReturn $aNum[0]\nEndFunc ;==>Hour2Sec\n\n","old_contents":"Local $iSec = \"1:30\"\n$iSec = Hour2Sec($iSec)\nConsoleWrite(\"$iSec[\" & $iSec & \"]\" & @LF)\n\n; #FUNCTION# ====================================================================================================================\n; Name...........: Hour2Sec\n; Description ...: Convert a string with hour data in seconds hh[ :mm[ :ss]]\n; Syntax.........: Hour2Sec(2)\n;\t\t\t\t Hour2Sec(\"2:30\")\n;\t\t\t\t Hour2Sec(\"02:30:45\")\n; Parameters ....: $mInput\n; Return values .: Integer, number of seconds\n; Author ........: Luismar Chechelaky\n; Modified.......: 2015\/06\/10\n; Remarks .......:\n; Related .......:\n; Link ..........:\n; Example .......:\n; ===============================================================================================================================\nFunc Hour2Sec($mInput = 0)\n\t$mInput = StringSplit($mInput, \":\", 2)\n\tLocal $aNum[5] = [0, 3600, 0, 0, 0]\n\tFor $ii = 0 To 2\n\t\tIf $ii < UBound($mInput, 1) And $mInput[$ii] >= 0 Then $aNum[$ii + 2] = $mInput[$ii] * $aNum[1]\n\t\t$aNum[0] += $aNum[$ii + 2]\n\t\t$aNum[1] \/= 60\n\tNext\n\tReturn $aNum[0]\nEndFunc ;==>Hour2Sec\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"AutoIt"} {"commit":"3094fa299ff8577436194b79341e6195c1988000","subject":"send messages binaries","message":"send messages binaries\n","repos":"MarceloSaied\/SubteBA","old_file":"helpers\/SendTelegramSubteBA\/SendTelegramSubteBA.au3","new_file":"helpers\/SendTelegramSubteBA\/SendTelegramSubteBA.au3","new_contents":"#Region ;**** Directives created by AutoIt3Wrapper_GUI ****\n#AutoIt3Wrapper_Icon=..\\..\\images\\RT1.ico\n#AutoIt3Wrapper_Outfile=SendTelegramSubteBA.exe\n#AutoIt3Wrapper_Compression=4\n#AutoIt3Wrapper_UseUpx=n\n#AutoIt3Wrapper_UseX64=y\n#AutoIt3Wrapper_Change2CUI=y\n#AutoIt3Wrapper_Res_Comment=\"By Marcelo N. Saied \"\n#AutoIt3Wrapper_Res_Description=\"Send Telegram application Message\"\n#AutoIt3Wrapper_Res_Fileversion=1.0.0.1\n#AutoIt3Wrapper_Res_ProductVersion=1.0\n#AutoIt3Wrapper_Res_LegalCopyright=Marcelo N. Saied\n#AutoIt3Wrapper_Res_Field=Productname|SendTelegramSubteBA.exe\n#AutoIt3Wrapper_Res_Field=ProductVersion|Version 1.0\n#AutoIt3Wrapper_Run_Obfuscator=y\n#Obfuscator_Parameters=\/mergeonly\n#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****\n; *** Start added by AutoIt3Wrapper ***\n#include \n; *** End added by AutoIt3Wrapper ***\n;===================================================================\n;===================================================================\n;=== ===\n;=== Name = SendTelegramSubteBA.exe ===\n;=== ===\n;=== Description:Send Telegram application Message ===\n;=== ===\n;=== Author: Marcelo N. Saied ===\n;=== marcelosaied@gmail.com ===\n;=== ===\n;=== Automation and Scripting Language: AUTOIT v3.3.8.1 ===\n;=== http:\/\/www.autoitscript.com\/site\/ ===\n;=== ===\n;=== Created on: Jan 9 , 2016 ===\n;=== ===\n;===================================================================\n;===================================================================\n#Region ------------ AutoIt3Wrapper\n$chatID=\"\"\n#EndRegion\n#Region ------------ Modules\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \"..\\..\\udf\\WinHttp.au3\"\n#EndRegion\n#Region ----------------------------- parse arguments ------------------------------\n; Help\n $helpText=\"Help: \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" Usage: \" & @crlf & _\n\t\t\t\" SendTelegramSubteBA.exe -m -chatid chatid \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" -m message \" & @crlf & _\n\t\t\t\" -chatid chatid \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" Author: Saied, Marcelo \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" 2017 \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \"\n;~\n\n if $CmdLine[0]=0 then\n\t ConsoleWrite($helpText)\n\t exit 1\n endif\n if StringStripWS($CmdLine[1],4)=\"?\" then ; output help\n\t ConsoleWrite($helpText)\n\t exit 3\n\tendif\n;~ \tConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $CmdLine[0] = ' & $CmdLine[0] & @crlf )\n if $CmdLine[0]<2 then ; if no 3 argumentes then exit -f filename -u username -p password ([-d][-nd])\n\t ConsoleWrite(\"No enough arguments. : SendTelegramSubteBA.exe -m -chatid chatid \")\n\t exit 5\n endif\n\n for $x=1 to $CmdLine[0]-1\n\t Select\n\t\tcase $CmdLine[$x] = \"-m\"\n\t\t\t$x = $x + 1\n\t\t\tif StringLen($CmdLine[$x]) > 2 then $mensaje=$CmdLine[$x]\n\t\tcase $CmdLine[$x] = \"-chatid\"\n\t\t\t$x = $x + 1\n\t\t\tif StringLen($CmdLine[$x]) > 2 then $chatID=$CmdLine[$x]\n\t\t Case Else\n\t\t\tConsoleWrite(\"No enough arguments : SendTelegram.exe -m \")\n\t\t\tConsoleWrite(\" SendTelegram.exe ? for help \")\n\t\t\tConsoleWrite(@CRLF)\n\t\t\texit 6\n\t EndSelect\n Next\n#EndRegion\n\nSendTelegram($mensaje)\nFunc SendTelegram($msgtext=\"testeo\")\n\tif SendTelegramexec($msgtext) Then\n\t\tsleep(3000)\n\t\tif $chatID<>\"\" then\tSendTelegramexec($msgtext)\n\tendif\nEndFunc\n\nFunc SendTelegramexec($msgtext=\"testeo harcoded\")\n\tlocal $token=IniRead(\"..\\..\\secret\\config.ini\",\"bot\",\"token\",\"\")\n\t$urlMSG=\"https:\/\/api.telegram.org\/\" & $token & \"\/sendMessage?chat_id=\" & $chatid & \"&text=\" & $msgtext\n\t$sGet = HttpGet($urlMSG)\n\n\tif $sGet<>\"0\" then\n\t\tConsoleWrite('Telegram Message sent = ' & $msgtext & @crlf )\n\t\treturn 0\n\tElse\n\t\t$s_text=\"Error sending message to Telegram = \"\n\t\treturn 1\n\tendif\nEndFunc\n\nexit\n","old_contents":"#Region ;**** Directives created by AutoIt3Wrapper_GUI ****\n#AutoIt3Wrapper_Icon=..\\..\\images\\RT1.ico\n#AutoIt3Wrapper_Outfile=SendTelegramSubteBA.exe\n#AutoIt3Wrapper_Compression=4\n#AutoIt3Wrapper_UseUpx=n\n#AutoIt3Wrapper_UseX64=y\n#AutoIt3Wrapper_Change2CUI=y\n#AutoIt3Wrapper_Res_Comment=\"By Marcelo N. Saied \"\n#AutoIt3Wrapper_Res_Description=\"Send Telegram application Message\"\n#AutoIt3Wrapper_Res_Fileversion=1.0.0.1\n#AutoIt3Wrapper_Res_ProductVersion=1.0\n#AutoIt3Wrapper_Res_LegalCopyright=Marcelo N. Saied\n#AutoIt3Wrapper_Res_Field=Productname|SendTelegramSubteBA.exe\n#AutoIt3Wrapper_Res_Field=ProductVersion|Version 1.0\n#AutoIt3Wrapper_Run_Obfuscator=y\n#Obfuscator_Parameters=\/mergeonly\n#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****\n; *** Start added by AutoIt3Wrapper ***\n#include \n; *** End added by AutoIt3Wrapper ***\n;===================================================================\n;===================================================================\n;=== ===\n;=== Name = SendTelegramSubteBA.exe ===\n;=== ===\n;=== Description:Send Telegram application Message ===\n;=== ===\n;=== Author: Marcelo N. Saied ===\n;=== marcelosaied@gmail.com ===\n;=== ===\n;=== Automation and Scripting Language: AUTOIT v3.3.8.1 ===\n;=== http:\/\/www.autoitscript.com\/site\/ ===\n;=== ===\n;=== Created on: Jan 9 , 2016 ===\n;=== ===\n;===================================================================\n;===================================================================\n#Region ------------ AutoIt3Wrapper\n$chatID=\"\"\n#EndRegion\n#Region ------------ Modules\n #include \n #include \n #include \n #include \n\t#include \n\t#include \n\t#include \n\t#include \"..\\..\\udf\\WinHttp.au3\"\n#EndRegion\n#Region ----------------------------- parse arguments ------------------------------\n; Help\n $helpText=\"Help: \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" Usage: \" & @crlf & _\n\t\t\t\" SendTelegramSubteBA.exe -m -chatid chatid \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" -m message \" & @crlf & _\n\t\t\t\" -chatid chatid \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" Author: Saied, Marcelo \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" 2017 \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \" & @crlf & _\n\t\t\t\" \"\n;~\n\n if $CmdLine[0]=0 then\n\t ConsoleWrite($helpText)\n\t exit 1\n endif\n if StringStripWS($CmdLine[1],4)=\"?\" then ; output help\n\t ConsoleWrite($helpText)\n\t exit 3\n\tendif\n;~ \tConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $CmdLine[0] = ' & $CmdLine[0] & @crlf )\n if $CmdLine[0]<2 then ; if no 3 argumentes then exit -f filename -u username -p password ([-d][-nd])\n\t ConsoleWrite(\"No enough arguments. : SendTelegramSubteBA.exe -m -chatid chatid \")\n\t exit 5\n endif\n\n for $x=1 to $CmdLine[0]-1\n\t Select\n\t\tcase $CmdLine[$x] = \"-m\"\n\t\t\t$x = $x + 1\n\t\t\tif StringLen($CmdLine[$x]) > 2 then $mensaje=$CmdLine[$x]\n\t\tcase $CmdLine[$x] = \"-chatid\"\n\t\t\t$x = $x + 1\n\t\t\tif StringLen($CmdLine[$x]) > 2 then $chatID=$CmdLine[$x]\n\t\t Case Else\n\t\t\tConsoleWrite(\"No enough arguments : SendTelegram.exe -m \")\n\t\t\tConsoleWrite(\" SendTelegram.exe ? for help \")\n\t\t\tConsoleWrite(@CRLF)\n\t\t\texit 6\n\t EndSelect\n Next\n#EndRegion\n\nSendTelegram($mensaje)\nFunc SendTelegram($msgtext=\"testeo\")\n\tif SendTelegramexec($msgtext) Then\n\t\tsleep(3000)\n\t\tif $chatID<>\"\" then\tSendTelegramexec($msgtext)\n\tendif\nEndFunc\n\nFunc SendTelegramexec($msgtext=\"testeo harcoded\")\n\tlocal $token=IniRead(\"..\\..\\secret\\config.ini\",\"bot\",\"token\",\"\")\n;~ \tlocal $token=\"bot401033255:AAGp6iC1iAOSVXIjCAZ3hFuSrtnpJo6Z8BM\" ; @SubteBA_bot\n\t$urlMSG=\"https:\/\/api.telegram.org\/\" & $token & \"\/sendMessage?chat_id=\" & $chatid & \"&text=\" & $msgtext\n\t$sGet = HttpGet($urlMSG)\n\n\tif $sGet<>\"0\" then\n\t\tConsoleWrite('Telegram Message sent = ' & $msgtext & @crlf )\n\t\treturn 0\n\tElse\n\t\t$s_text=\"Error sending message to Telegram = \"\n\t\treturn 1\n\tendif\nEndFunc\n\nexit","returncode":0,"stderr":"","license":"mit","lang":"AutoIt"} {"commit":"47d6ccf28927f7c72975128f5e6fd660a251761f","subject":"latest version","message":"latest version\n","repos":"imakin\/PersonalAssistant,imakin\/PersonalAssistant,imakin\/PersonalAssistant,imakin\/PersonalAssistant","old_file":"GameBot\/marvel_arena.au3","new_file":"GameBot\/marvel_arena.au3","new_contents":";Shift+alt\nHotKeySet(\"+!a\", \"startArena\")\nHotKeySet(\"+!z\", \"changeArenaTier\")\nHotKeySet(\"+!s\", \"idle\")\nHotKeySet(\"+!d\", \"fight\")\nHotKeySet(\"+!f\", \"findMatch\")\nHotKeySet(\"+!g\", \"nextNode\")\nHotKeySet(\"+!h\", \"fightArena\")\nHotKeySet(\"+!q\", \"Duel\")\nHotKeySet(\"+!p\", \"playthegame\")\nHotKeySet(\"+!c\", \"calibrateWindow\")\nHotKeySet(\"+!i\", \"showStatus\")\n\n\nGlobal $status=\"ngondek\"\nGlobal $savepixel = 0\nGlobal $screensave[6]\n$screensave[0] = 0\n$screensave[1] = 0\n$screensave[2] = 0\n$screensave[3] = 0\n$screensave[4] = 0\n$screensave[5] = 0\n\n;This indicates which arena tier shall be played, possible is 2, or 3\n$arena_tier = 2\n$arena_continue = 1\n$allstop = 0\nDo\n Sleep(1)\nUntil False\n\nFunc showStatus()\n ToolTip(StringFormat(\"%s\", $status),0,0)\nEndFunc\n\n\nFunc idle()\n $status = \"idle\"\n $allstop = 1\n MsgBox(0, \"now\", \"terminated\", 1)\n Do\n\t Sleep(1)\n Until False\nEndFunc ;==>Terminate\n \n \nFunc playthegame()\n MouseClick(\"left\", 26, 750) ;window start menu\n MouseClick(\"left\", 70, 400) ;bluestack app\n Sleep(90000)\n MsgBox(0, \"now\", \"i will now move the bluestack window\", 5)\n MouseClickDrag(\"left\", 90, 30, 75, 15)\n Sleep(2000)\n MouseClick(\"left\", 913, 307) ;click the game \n Sleep(60000)\n playthearena()\nEndFunc\nFunc playthearena()\n MouseClick(\"left\", 162, 51)\n Sleep(1000)\n MouseClick(\"left\", 271, 135) ;fight button\n Sleep(20000)\n MouseClick(\"left\", 535, 313) ;versus\n Sleep(20000)\n startArena()\nEndFunc\n\nFunc changeArenaTier()\n if ($arena_tier==2) Then\n\t $arena_tier = 3\n\t MsgBox(0, \"arena tier\", \"arena tier is now 3\", 2)\n Elseif ($arena_tier==3) Then\n\t $arena_tier = 4\n\t MsgBox(0, \"arena tier\", \"arena tier is now alltier(when there is no event)\", 2)\n ElseIf ($arena_tier==4) Then\n\t $arena_tier = 5\n\t MsgBox(0, \"arena tier\", \"arena tier is now 5, the special high lvl arena(catalyst, alpha)\", 2)\n Else \n\t $arena_tier = 2\n\t MsgBox(0, \"arena tier\", \"arena tier is now 2\", 2)\n EndIf\nEndFunc\n\n;Starts the arena (Fight menu), and continue (tier *2)\nFunc startArena()\n $status = \"start arena\"\n $allstop = 0\n Do\n\t calibrateWindow()\n\t $arena_continue = 1\n\t \n\t Sleep(500)\n\t if ($arena_tier==5) Then\n\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t Sleep(500)\n\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t Sleep(500)\n\t Else\n\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t Sleep(500)\n\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t EndIf\n\t Sleep(1000)\n\t \n\t checkInsideFight()\n\t \n\t if (Not(getDominantColor(PixelGetColor(346,535))==\"green\") AND (Not($arena_tier==5))) Then\n\t\t MsgBox(0, \"fight\", \"inside fight menu, not arena\", 1)\n\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t Sleep(400)\n\t\t MouseClick(\"left\", 500,446)\n\t\t Sleep(2000)\n\t\t Local $wait = 0\n\t\t do\n\t\t\tSleep(1000)\n\t\t\t$wait = $wait+1\n\t\t\tcheckInsideFight()\n\t\t Until (getDominantColor(PixelGetColor(435,525))==\"green\" OR ($wait>10))\n\t EndIf\n\t \n\t ;check if currently in one of 3 fights\n\t if (PixelGetColor(160,222)==0x2b2c30 AND PixelGetColor(816,222)==0x2b2c30) Then\n\t\t Local $leftresult=PixelGetColor(294,280) ;lose 721a1a red, win 26552e\n\t\t Local $rightresult=PixelGetColor(697,280)\n\t\t if ($leftresult==0x26552e OR $leftresult==0x721a1a) Then\n\t\t\tif ($rightresult==0x26552e OR $rightresult==0x721a1a) Then\n\t\t\t MsgBox(0, \"fight\", \"more fight to go\", 1)\n\t\t\t Sleep(1000)\n\t\t\t MouseClick(\"left\", 200,200)\n\t\t\t fightArena()\n\t\t\t $arena_continue = 0\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t checkInsideFight()\n\t if ($arena_continue==1) Then\n\t\t if ($arena_tier==2) Then\n\t\t\t;Send(\"9\")\n\t\t\tMouseClick(\"left\", 386, 446)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 413, 522);double check\n\t\t Elseif ($arena_tier==3) Then\n\t\t\tMouseClick(\"left\", 830, 510)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 760, 508);double check\n\t\t Elseif ($arena_tier==4) Then ;arena tier 4\n\t\t\tMouseClick(\"left\", 433, 522);\n\t\t\tSleep(5000);\n\t\t Else\n\t\t\t\n\t\t\tif (Not(getDominantColor(PixelGetColor(595,516))==\"green\") AND Not(getDominantColor(PixelGetColor(438,516))==\"green\")) Then\n\t\t\t MsgBox(0, \"fight\", \"inside fight menu, not arena (special)\", 1)\n\t\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\t MouseClick(\"left\", 500,446)\n\t\t\t Local $wait = 0\n\t\t\t do\n\t\t\t\t Sleep(1000)\n\t\t\t\t $wait = $wait+1\n\t\t\t\t checkInsideFight()\n\t\t\t Until (getDominantColor(PixelGetColor(595,516))==\"green\" OR ($wait>10))\n\t\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\tEndIf\n\t\t\tcheckInsideFight()\n\t\t\tif (getDominantColor(PixelGetColor(438,516))==\"green\") Then\n\t\t\t MouseClick(\"left\",438,516)\n\t\t\tElse\n\t\t\t MouseClick(\"left\", 674, 508);\n\t\t\tEndIf\n\t\t\tSleep(5000);\n\t\t EndIf\n\t EndIf\n\t \n\t checkInsideFight()\n\t Sleep(5000)\n\t Local $current_arena_tier = $arena_tier\n\t \n\t askForHelp()\n\t checkInsideFight()\n\t if ($arena_continue==1) Then\n\t\t ; We have energy, continue;else change arena tier in next loop\n\t\t addToTeam()\n\t\t findMatch()\n\t\t fightArena()\n\t EndIf\n\t \n Until ($allstop==1)\nEndFunc\n\nFunc askForHelp()\n $status = \"ask for help\"\n Local $carryon = 1\n Do\n\t ;Detect if we can ask for help\n\t Local $helpbutton = PixelGetColor(260, 175)\n\t Local $red = BitShift($helpbutton, 16)\n\t Local $green = BitShift(BitAND($helpbutton, 0x00FF00), 8)\n\t Local $blue = BitAND($helpbutton, 0x0000FF)\n\t if ($green > $red) Then\n\t\t if ($green > $blue) Then\n\t\t\tSend(\"Q\")\n\t\t\tSleep(3000)\n\t\t Else\n\t\t\t$carryon = 0\n\t\t EndIf\n\t Else\n\t\t $carryon = 0\n\t EndIf\n Until ($carryon==0)\n \n ;Detect if less than 3 champion has energy\n Local $redtag = PixelGetColor(630,188)\n Local $red = BitShift($redtag, 16)\n Local $green = BitShift(BitAND($redtag, 0x00FF00), 8)\n Local $blue = BitAND($redtag, 0x0000FF)\n if (($red-80) > $green) Then\n\t if (($red-80) > $blue) Then\n\t\t MsgBox(0, \"Out of energy\", \"we're out of energy\", 2)\n\t\t $arena_continue = 0\n\t\t Sleep(4000)\n\t\t MouseClick(\"left\", 57, 55)\n\t\t if ($arena_tier==2) Then\n\t\t\t$arena_tier = 3\n\t\t Elseif ($arena_tier==3) Then\n\t\t\t$arena_tier = 2\n\t\t EndIf\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n ;Detect if there are any Reconnect popup\n if (PixelGetColor(490,320)==0x2b2c30) Then\n\t if (getDominantColor(PixelGetColor(490,350))==\"green\") Then\n\t\t MsgBox(0, \"popup\", \"I'll press the popup button in 5\", 5)\n\t\t Sleep(6000)\n\t\t MouseClick(\"left\", 490, 350)\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n ;detect if we're in useless milestone info\n if (getDominantColor(PixelGetColor(934,555))==\"green\") Then\n\t if ((PixelGetColor(492,337)==0x2b2c30)) Then\n\t\t MsgBox(0, \"milestone\", \"I assume we're in milestone info\", 1)\n\t\t Sleep(1000)\n\t\t $arena_continue = 0\n\t\t MouseClick(\"left\", 57, 55)\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n \n ;if we're in continue next fight\n if (getDominantColor(PixelGetColor(936,556))==\"green\") Then\n\t if (PixelGetColor(688,436)==0x191e23) Then\n\t\t $arena_continue = 0\n\t\t fightArena()\n\t EndIf\n EndIf\nEndFunc\n\n;arena\nFunc addToTeam()\n $status = \"add to team\"\n MouseClickDrag(\"left\", 319, 235, 145, 135)\n sleep(500)\n MouseClickDrag(\"left\", 319, 235, 145, 210)\n sleep(500)\n MouseClickDrag(\"left\", 319, 235, 145, 290)\n sleep(500)\nEndFunc\n\n;Arena\nFunc findMatch()\n $status = \"find match\"\n Sleep(500)\n MouseClick(\"left\", 109, 547)\n\t\t \n\t\t checkInsideFight()\n Sleep(4000)\n \n \n PixelSearch(543,416,575,429, 0x319732)\n if (@error) Then\n\t ;highest is not easy, check if mid easy\n\t PixelSearch(543,280,575,294, 0x319732)\n\t if (@error) Then\n\t\t ;mid is not easy\n\t\t MsgBox(0,\"tier\", \"mid and high is not easy\",1)\n\t\t MouseClick(\"left\", 600,200)\n\t Else\n\t\t ;mid is easy\n\t\t MouseClick(\"left\", 600,320)\n\t EndIf\n Else\n\t ;highest is easy\n\t MouseClick(\"left\", 687, 445)\n EndIf\n\t\t \n\t\t checkInsideFight()\n Sleep(3000)\n Send(\"0\")\n $c = PixelGetColor(841,574)\n if (GetDominantColor($c)==\"green\") Then\n\t Sleep(3000)\n Else\n\t Local $t = 0\n\t Local $cont = 1\n\t Do\n\t\t Sleep(500)\n\t\t if ($t>120) Then\n\t\t\t;stuck\n\t\t\t$cont = 0\n\t\t EndIf\n\t\t if (Not(PixelGetColor(841,574)==$c)) Then\n\t\t\t$cont = 0\n\t\t EndIf\n\t\t $t = $t+1\n\t Until ($cont==0)\n EndIf\nEndFunc\n\n;Fight in arena\nFunc fightArena()\n $status = \"fight arena\"\n $seq = 0\n $stop = 0\n $allstop = 0\n \n ;stuck in something handler\n Local $somewhereoutsidecounter = 0\n Local $stuckseq = 0\n Local $startarena = TimerInit()\n Local $arenatimersecond = 0\n Do\n\t $stuckseq = $stuckseq+1\n\t if (Mod($stuckseq,400)==0) Then\n\t\t $stuqseq = 1\n\t\t ;ToolTip(\"check stuck\")\n\t\t if (checkStuck()) Then\n\t\t\tupdateCapture()\n\t\t\t$stop = 1\n\t\t\tMsgBox(0, \"popup\", \"i guess we're stuck\", 2)\n\t\t\t\n\t\t\t;stuck in leaderboard\n\t\t\tif (PixelGetColor(921,138)==0x292c30) Then\n\t\t\t if (PixelGetColor(939,61)==0x6c6e71) Then\n\t\t\t\t MsgBox(0, \"popup\", \"leaderboard, ill close it\", 1)\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 939,61)\n\t\t\t\t Sleep(3000)\n\t\t\t EndIf\n\t\t\tEndIf\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\n\t\t\t\n\t\t\tSleep(10000)\n\t\t EndIf\n\t\t updateCapture()\n\t\t \n\t\t ;check if too long playing maybe something is not right\n\t\t Local $dif = TimerDiff($startarena)\n\t\t if ($dif > 30000) Then\n\t\t\t$startarena = TimerInit()\n\t\t\t$arenatimersecond = $dif\/1000\n\t\t EndIf\n\t\t if ($arenatimersecond > 240) Then\n\t\t\tMsgBox(0, \"popup\", \"too long minutes \", 3)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 138, 58) ;menu double\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t Send(\"0\")\n\t Sleep(1);\n\t if (Mod($seq, 4)==0) Then\n\t\t Send(\"K\")\n\t EndIf\n\t $seq = $seq + 1\n\t if ($seq>15) then\n\t\t Send(\"{SPACE}\")\n\t\t if ($seq>20) Then\n\t\t\t$seq = 0\n\t\t EndIf\n\t EndIf\n\t if (getDominantColor(PixelGetColor(144,541))==\"red\") then\n\t\t Send(\"{SPACE}\")\n\t EndIf\n\t \n\t ;indicates fight has ended (loading screen)\n\t $loading = PixelGetColor(640, 540);\n\t if ($loading==0x025c00) Then\n\t\t $loading = PixelGetColor(620, 300)\n\t\t if ($loading==0x161a1b) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0, \"popup\", \"shall i press back button? (loading screen)\", 2)\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 57, 55); back because we might ended up in 3* 4* tier arena\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;or chat bar has been clicked\n\t if ($loading==0x161a1d) Then\n\t\t if (PixelGetColor(136,540)==0x292c30) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0,\"chat\", \"this is chat window\", 1)\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 943, 52); close\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 138, 58) ;menu double\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\t\t\tSleep(5000)\n\t\t EndIf\n\t EndIf\n\t \n\t ; or the case if we ended up in view rewards\n\t $loading = PixelGetColor(480,270)\n\t if ($loading==0x2b2c30) Then\n\t\t $loading = PixelGetColor(480,330)\n\t\t if ($loading==0x2b2c30) Then\n\t\t\tMsgBox(0, \"popup\", \"(view rewards) ?(TODO)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(300)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\t;Sleep(10000)\n\t\t EndIf\n\t ElseIf ($loading==0x000000) Then\n\t\t ; stuck in alliance quest window; todo alliance quest window with empty quest\n\t\t if (PixelGetColor(838,366)==0x2b2c30) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0,\"alliance q\", \"alliance quest cuy\", 1);\n\t\t\t;$arena_tier = 2\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 57, 55); \n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;stuck in alliance quest window\n\t $loading = PixelGetColor(384,142)\n\t if ($loading==0x1a1a1a) Then\n\t\t if (PixelGetColor(551,142)==0x1a1a1a) Then\n\t\t\tif (Not(PixelGetColor(504,142)==0x1a1a1a)) Then\n\t\t\t $stop = 1\n\t\t\t MsgBox(0,\"alliance q\", \"empty alliance quest cuy\", 1);\n\t\t\t ;$arena_tier = 2\n\t\t\t Sleep(2000)\n\t\t\t MouseClick(\"left\", 57, 55); \n\t\t\t Sleep(10000)\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t \n\t ;MsgBox(0, \"dbg\", StringFormat(\"%X\", PixelGetColor(18,130)), 1)\n\t ; or the case we stuck in team adding\n\t if (PixelGetColor(18, 130)==0x2b2c30) Then ; the left bar team list\n\t\t if (PixelGetColor(936,511)==0x2b2c30) Then ;the champion filter button\n\t\t\tMsgBox(0, \"popup\", \"(team adding)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t if (PixelGetColor(18, 130)==0x0b0b0c) Then ; the left bar team list\n\t\t if (PixelGetColor(936,511)==0x0b0b0c) Then ;the champion filter button\n\t\t\tMsgBox(0, \"popup\", \"(team adding dark)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;or the case we're in somewhere outside (menu)\n\t if (PixelGetColor(955,50)==0x2b2c30) Then\n\t\t if (PixelGetColor(955, 562)==0x1d2630) Then\n\t\t\tif (Not(getDominantColor(PixelGetColor(936,556))==\"green\")) Then\n\t\t\t $somewhereoutsidecounter = $somewhereoutsidecounter+1\n\t\t\t if ($somewhereoutsidecounter>20) Then\n\t\t\t\t MsgBox(0, \"popup\", \"(somewhere outside for too long)\", 2)\n\t\t\t\t $stop = 1\n\t\t\t\t Sleep(1000)\n\t\t\t\t Send(\"J\")\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 138, 58) ;menu double\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 270, 132) ;fight\n\t\t\t\t Sleep(5000)\n\t\t\t EndIf\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t\t\t\n Until ($stop==1 or $allstop==1)\nEndFunc\n\n\n;FIGHT In quest\nFunc fight()\n $seq = 0\n $stop = 0\n $allstop = 0\n Do\n\t Send(\"0\")\n\t Sleep(30);\n\t $seq = $seq + 1\n\t if (Mod($seq, 4)==0) Then\n\t\t Send(\"K\")\n\t EndIf\n\t if ($seq>12) then\n\t\t Send(\"{SPACE}\")\n\t\t if ($seq>20) Then\n\t\t\t$seq = 0\n\t\t EndIf\n\t EndIf\n\t \n\t if (Mod($seq,2)==0) Then\n\t\t $loading = PixelGetColor(958, 577);\n\t\t if ($loading==0x1d2630) Then \n\t\t ;indicates fight has ended\n\t\t\t$loading = PixelGetColor(923, 491)\n\t\t\tif ($loading==0xc1c1c2) Then\n\t\t\t $stop = 1\n\t\t\t Sleep(3000)\n\t\t\t Send(\"J\")\n\t\t\tEndIf\n\t\t ElseIf ($loading==0x07090c) Then\n\t\t\tif (PixelGetColor(825,105)==0x2b2c30) Then\n\t\t\t $stop = 1\n\t\t\t Sleep(3000)\n\t\t\t Send(\"J\")\n\t\t\tEndIf\n\t\t ;Elseif (PixelGetColor(486,310)==0xeeeeee) Then\n\t\t\t;we're in loading screen\n\t\t\t;$stop = 1\n\t\t\t;Sleep(3000)\n\t\t\t;Send(\"J\")\n\t\t EndIf\n\t EndIf\n\t ;quest completed!\n\t Local $ca = PixelGetColor(204,190)\n\t if ($ca==0x2b2c30) Then\n\t\t Local $cb = PixelGetColor(739,514)\n\t\t\tif ($cb==0x2b2c30) Then\n\t\t\t if (getDominantColor(PixelGetColor(310,485))==\"green\" AND getDominantColor(PixelGetColor(741,485))==\"green\") Then\n\t\t\t\t $stop = 1\n\t\t\t\t Sleep(7000)\n\t\t\t\t MsgBox(0,\"finished\", \"finished\", 2)\n\t\t\t\t MouseClick(\"left\", 300,475);back to quest button\n\t\t\t\t Sleep(15000)\n\t\t\t\t \n\t\t\t\t MsgBox(0,\"arena\", \"my creator is away, i'll continue to arena to kill the time\",2)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 270, 132) ;fight\n\t\t\t\t Sleep(15000)\n\t\t\t\t startArena()\n\t\t\t EndIf\n\t\t\tEndIf\n\t EndIf\n Until ($stop==1 or $allstop==1)\nEndFunc\n\n\nFunc nextNode()\n $allstop = 0\n Do\n\t Local $step = 0\n\t Do\n\t\t $step = $step + 1\n\t\t if ($step == 10) Then\n\t\t\tMouseClickDrag(\"left\", 450, 320, 642, 346)\n\t\t ElseIf ($step == 20) Then\n\t\t\tMouseClickDrag(\"left\", 450, 320, 200, 200)\n\t\t\tMouseClickDrag(\"left\", 450, 320, 300, 300)\n\t\t ElseIf ($step == 30) Then\n\t\t\tMouseClickDrag(\"left\", 700, 100, 100, 400)\n\t\t ElseIf ($step == 40) Then\n\t\t\tMouseClickDrag(\"left\", 100, 400, 700, 100)\n\t\t\tMouseClickDrag(\"left\", 100, 400, 700, 100)\n\t\t\t$step = 0\n\t\t EndIf\n\t\t Send(\"J\")\n\t\t Sleep(200)\n\t\t $greendot = PixelSearch(80,100, 957, 530, 0x00f800)\n\t\t if (@error) Then\n\t\t\t$greendot = PixelSearch(80,100, 957, 530, 0x00e400)\n\t\t EndIf\n\t Until not(@error)\n\t Send(\"J\")\n\t MouseMove($greendot[0], $greendot[1])\n\t MsgBox(0, \"now\", \"i will click this in 4s\", 1)\n\t Sleep(4000)\n\t MouseClick(\"left\", $greendot[0], $greendot[1])\n\t Sleep(500)\n\t MouseClick(\"left\", $greendot[0], $greendot[1])\n\t Sleep(10000)\n\t fight()\n\t Sleep(4000)\n\t Send(\"J\")\n Until ($allstop==1)\nEndFunc\n\nFunc getDominantColor($color)\n Local $red = BitShift($color, 16)\n Local $green = BitShift(BitAND($color, 0x00FF00), 8)\n Local $blue = BitAND($color, 0x0000FF)\n if ($red > $green And $red > $blue) Then\n\t Return (\"red\")\n ElseIf ($green > $blue And $green > $red) Then\n\t Return (\"green\")\n ElseIf ($blue > $red And $blue > $green) Then\n\t Return (\"blue\")\n Else\n\t if ($red > $green or $red > $blue) Then\n\t\t Return (\"red\")\n\t ElseIf ($green > $blue or $green > $red) Then\n\t\t Return (\"green\")\n\t Else\n\t\t Return (\"blue\")\n\t EndIf\n EndIf\nEndFunc\n\n;Calibrate the bluestack window position\n;@param $width the width of the screen to search\n;@param $height the height of the screen to search\nFunc calibrateWindow($width=1366,$height=768)\n ;searching bluestack logo\n Local $repeat = 1\n Do\n\t $icon = PixelSearch(0,0,1366,768, 0x79af1b);\n\t if (@error) Then\n\t\t MsgBox(0,\"failed\", \"can't find bluestack window\", 3)\n\t Else\n\t\t $find = PixelSearch($icon[0]-8, $icon[1], $icon[0]+8, $icon[1]+10, 0xf6d502)\n\t\t if (not(@error)) Then\n\t\t\t$find = PixelSearch($icon[0]-8,$icon[1], $icon[0]+8, $icon[1]+10, 0xdd3a17)\n\t\t\tif (not(@error)) Then\n\t\t\t MouseClickDrag(\"left\", $icon[0]+14, $icon[1], 30, 12)\n\t\t\t $repeat = 0\n\t\t\tEndIf\n\t\t EndIf\n\t\t ;next color\n\t EndIf\n\t \n Until ($repeat==0)\nEndFunc\n\n\n;perform check if we're stuck in a room (any current click affects nothing)\n;return True if stuck, False if not\nFunc checkStuck()\n ; check if we're stuck in some room\n $samepixel = 0\n if (Not(PixelGetColor(100,100)==$screensave[0])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(400,100)==$screensave[1])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(700,100)==$screensave[2])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(100,500)==$screensave[3])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(498,298)==$screensave[4])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(700,500)==$screensave[5])) Then\n\t Return False\n EndIf\n Return True\nEndFunc\n\n;update $screensave to current capture\nFunc updateCapture()\n $screensave[0] = PixelGetColor(100,100)\n if ($screensave[0]==0x2a1a4c) Then ;we don't want to save loading screen;TODO REUPDATGE THESE\n\t $screensave[0] = 0\n EndIf\n $screensave[1] = PixelGetColor(400,100)\n if ($screensave[1]==0x201641) Then\n\t $screensave[1] = 0\n EndIf\n $screensave[2] = PixelGetColor(700,100)\n if ($screensave[2]==0x580e2f) Then\n\t $screensave[2] = 0\n EndIf\n $screensave[3] = PixelGetColor(100,500)\n if ($screensave[3]==0x2f1661) Then\n\t $screensave[3] = 0\n EndIf\n $screensave[4] = PixelGetColor(498,298)\n if ($screensave[4]==0x014cbe) Then\n\t $screensave[4] = 0\n EndIf\n $screensave[5] = PixelGetColor(700,500)\n if ($screensave[5]==0x7d1852) Then\n\t $screensave[5] = 0\n EndIf\nEndFunc\n\n\nFunc checkInsideFight()\n if (isInsideFight()) Then\n\t MsgBox(0,\"fight\", \"inside FIGHT!\",1)\n\t Sleep(500)\n\t MouseClick(\"left\",200,200)\n\t $arena_continue = 0\n\t fightArena()\n\t return 1\n Else\n\t return 0\n EndIf\nEndFunc\n;Check if currently in fight\n;return 1 if true, 0 false\nFunc isInsideFight()\n ;check if there is pause button\n Local $leftborder = 0\n Local $rightborder = 0\n $leftborder = PixelGetColor(466,57)\n $rightborder = PixelGetColor(511,57)\n if ($leftborder==0x222222 OR $leftborder==0x212121) Then\n\t if ($rightborder==0x222222 OR $rightborder==0x212121) Then\n\t\t if ((PixelGetColor(483,57)==0x9cba9b AND PixelGetColor(493,57)==0x9cba9b) AND getDominantColor(PixelGetColor(488,57))==\"green\") Then\n\t\t\treturn 1\n\t\t EndIf\n\t EndIf\n EndIf\n return 0\nEndFunc\n\n\nFunc Duel()\n Local $count=5;Limit count here\n Do\n\t MouseClick(\"left\", 276,97)\n\t Sleep(1000)\n\t Send(\"rooster 210\");name to search\n\t Sleep(1000)\n\t MouseClick(\"left\", 772,102)\n\t Sleep(5000)\n\t \n\t ;2nd search position\n\t\t MouseClick(\"left\", 286,246)\n\t\t Sleep(1000)\n\t\t MouseClick(\"left\", 445,246)\n\t\t Sleep(4000)\n\t \n\t MouseClick(\"left\", 616,453);continue\n\t Sleep(4000)\n\t MouseClick(\"left\", 103,547);start\n\t fightDuel()\n\t Sleep(2000)\n\t $count = $count - 1\n Until ($allstop==1 OR $count==0)\nEndFunc\n\n;Fight in duel\nFunc fightDuel()\n $seq = 0\n $stop = 0\n $allstop = 0\n \n ;stuck in something handler\n Local $somewhereoutsidecounter = 0\n Local $stuckseq = 0\n Local $startarena = TimerInit()\n Local $arenatimersecond = 0\n Do\n\t $stuckseq = $stuckseq+1\n\t if (Mod($stuckseq,400)==0) Then\n\t\t ;check if too long playing maybe something is not right\n\t\t Local $dif = TimerDiff($startarena)\n\t\t if ($dif > 30000) Then\n\t\t\t$startarena = TimerInit()\n\t\t\t$arenatimersecond = $dif\/1000\n\t\t EndIf\n\t\t if ($arenatimersecond > 240) Then\n\t\t\tMsgBox(0, \"popup\", \"too long minutes \", 3)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 138, 58) ;menu double\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t Send(\"0\")\n\t Sleep(1);\n\t if (Mod($seq, 4)==0) Then\n\t\t Send(\"K\")\n\t EndIf\n\t $seq = $seq + 1\n\t if ($seq>15) then\n\t\t Send(\"{SPACE}\")\n\t\t if ($seq>20) Then\n\t\t\t$seq = 0\n\t\t EndIf\n\t EndIf\n\t if (getDominantColor(PixelGetColor(144,541))==\"red\") then\n\t\t Send(\"{SPACE}\")\n\t EndIf\n\t $loading = PixelGetColor(640, 540);\n\t ;or chat bar has been clicked\n\t if ($loading==0x161a1d) Then\n\t\t if (PixelGetColor(136,540)==0x292c30) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0,\"chat\", \"this is chat window\", 1)\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 943, 52); close\n\t\t\tSleep(2000)\n\t\t EndIf\n\t EndIf\n\t if (PixelGetColor(690,105)==0x161a1d AND PixelGetColor(800,105)==0x035d01 AND PixelGetColor(841,105)==0x515151) Then\n\t\t MsgBox(0, \"done\", \"done\", 1)\n\t\t Sleep(1000)\n\t\t $stop = 1\n\t EndIf\n Until ($stop==1 or $allstop==1)\nEndFunc\n","old_contents":";Shift+alt\nHotKeySet(\"+!a\", \"startArena\")\nHotKeySet(\"+!z\", \"changeArenaTier\")\nHotKeySet(\"+!s\", \"idle\")\nHotKeySet(\"+!d\", \"fight\")\nHotKeySet(\"+!f\", \"findMatch\")\nHotKeySet(\"+!g\", \"nextNode\")\nHotKeySet(\"+!h\", \"fightArena\")\nHotKeySet(\"+!p\", \"playthegame\")\nHotKeySet(\"+!c\", \"calibrateWindow\")\n\n\nGlobal $savepixel = 0\nGlobal $screensave[6]\n$screensave[0] = 0\n$screensave[1] = 0\n$screensave[2] = 0\n$screensave[3] = 0\n$screensave[4] = 0\n$screensave[5] = 0\n\n;This indicates which arena tier shall be played, possible is 2, or 3\n$arena_tier = 2\n$arena_continue = 1\n$allstop = 0\nDo\n Sleep(1)\nUntil False\n\n\nFunc idle()\n $allstop = 1\n MsgBox(0, \"now\", \"terminated\", 1)\n Do\n\t Sleep(1)\n Until False\nEndFunc ;==>Terminate\n \n \nFunc playthegame()\n MouseClick(\"left\", 26, 750) ;window start menu\n MouseClick(\"left\", 70, 400) ;bluestack app\n Sleep(90000)\n MsgBox(0, \"now\", \"i will now move the bluestack window\", 5)\n MouseClickDrag(\"left\", 90, 30, 75, 15)\n Sleep(2000)\n MouseClick(\"left\", 913, 307) ;click the game \n Sleep(60000)\n playthearena()\nEndFunc\nFunc playthearena()\n MouseClick(\"left\", 162, 51)\n Sleep(1000)\n MouseClick(\"left\", 271, 135) ;fight button\n Sleep(20000)\n MouseClick(\"left\", 535, 313) ;versus\n Sleep(20000)\n startArena()\nEndFunc\n\nFunc changeArenaTier()\n if ($arena_tier==2) Then\n\t $arena_tier = 3\n\t MsgBox(0, \"arena tier\", \"arena tier is now 3\", 2)\n Elseif ($arena_tier==3) Then\n\t $arena_tier = 4\n\t MsgBox(0, \"arena tier\", \"arena tier is now alltier(when there is no event)\", 2)\n ElseIf ($arena_tier==4) Then\n\t $arena_tier = 5\n\t MsgBox(0, \"arena tier\", \"arena tier is now 5, the special high lvl arena(catalyst, alpha)\", 2)\n Else \n\t $arena_tier = 2\n\t MsgBox(0, \"arena tier\", \"arena tier is now 2\", 2)\n EndIf\nEndFunc\n\n;Starts the arena (Fight menu), and continue (tier *2)\nFunc startArena()\n $allstop = 0\n Do\n\t calibrateWindow()\n\t $arena_continue = 1\n\t \n\t Sleep(500)\n\t if ($arena_tier==5) Then\n\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t Sleep(500)\n\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t Sleep(500)\n\t Else\n\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t EndIf\n\t Sleep(1000)\n\t \n\t checkInsideFight()\n\t \n\t if (Not(getDominantColor(PixelGetColor(346,535))==\"green\") AND (Not($arena_tier==5))) Then\n\t\t MsgBox(0, \"fight\", \"inside fight menu, not arena\", 1)\n\t\t MouseClick(\"left\", 500,446)\n\t\t Sleep(2000)\n\t\t Local $wait = 0\n\t\t do\n\t\t\tSleep(1000)\n\t\t\t$wait = $wait+1\n\t\t\tcheckInsideFight()\n\t\t Until (getDominantColor(PixelGetColor(435,525))==\"green\" OR ($wait>10))\n\t EndIf\n\t \n\t ;check if currently in one of 3 fights\n\t if (PixelGetColor(160,222)==0x2b2c30 AND PixelGetColor(816,222)==0x2b2c30) Then\n\t\t Local $leftresult=PixelGetColor(294,280) ;lose 721a1a red, win 26552e\n\t\t Local $rightresult=PixelGetColor(697,280)\n\t\t if ($leftresult==0x26552e OR $leftresult==0x721a1a) Then\n\t\t\tif ($rightresult==0x26552e OR $rightresult==0x721a1a) Then\n\t\t\t MsgBox(0, \"fight\", \"more fight to go\", 1)\n\t\t\t Sleep(1000)\n\t\t\t MouseClick(\"left\", 200,200)\n\t\t\t fightArena()\n\t\t\t $arena_continue = 0\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t checkInsideFight()\n\t if ($arena_continue==1) Then\n\t\t if ($arena_tier==2) Then\n\t\t\t;Send(\"9\")\n\t\t\tMouseClick(\"left\", 386, 446)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 413, 522);double check\n\t\t Elseif ($arena_tier==3) Then\n\t\t\tMouseClick(\"left\", 830, 510)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 760, 508);double check\n\t\t Elseif ($arena_tier==4) Then ;arena tier 4\n\t\t\tMouseClick(\"left\", 433, 522);\n\t\t\tSleep(5000);\n\t\t Else\n\t\t\t\n\t\t\tif (Not(getDominantColor(PixelGetColor(595,516))==\"green\") AND Not(getDominantColor(PixelGetColor(438,516))==\"green\")) Then\n\t\t\t MsgBox(0, \"fight\", \"inside fight menu, not arena (special)\", 1)\n\t\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\t MouseClickDrag(\"left\", 130, 255, 700, 255);drag left mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\t MouseClick(\"left\", 500,446)\n\t\t\t Local $wait = 0\n\t\t\t do\n\t\t\t\t Sleep(1000)\n\t\t\t\t $wait = $wait+1\n\t\t\t\t checkInsideFight()\n\t\t\t Until (getDominantColor(PixelGetColor(595,516))==\"green\" OR ($wait>10))\n\t\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t\t MouseClickDrag(\"left\", 700, 255, 130, 255);drag right mosst for foolproof\n\t\t\t Sleep(1000)\n\t\t\tEndIf\n\t\t\tcheckInsideFight()\n\t\t\tif (getDominantColor(PixelGetColor(438,516))==\"green\") Then\n\t\t\t MouseClick(\"left\",438,516)\n\t\t\tElse\n\t\t\t MouseClick(\"left\", 674, 508);\n\t\t\tEndIf\n\t\t\tSleep(5000);\n\t\t EndIf\n\t EndIf\n\t \n\t checkInsideFight()\n\t Sleep(5000)\n\t Local $current_arena_tier = $arena_tier\n\t \n\t askForHelp()\n\t checkInsideFight()\n\t if ($arena_continue==1) Then\n\t\t ; We have energy, continue;else change arena tier in next loop\n\t\t addToTeam()\n\t\t findMatch()\n\t\t fightArena()\n\t EndIf\n\t \n Until ($allstop==1)\nEndFunc\n\nFunc askForHelp()\n Local $carryon = 1\n Do\n\t ;Detect if we can ask for help\n\t Local $helpbutton = PixelGetColor(260, 175)\n\t Local $red = BitShift($helpbutton, 16)\n\t Local $green = BitShift(BitAND($helpbutton, 0x00FF00), 8)\n\t Local $blue = BitAND($helpbutton, 0x0000FF)\n\t if ($green > $red) Then\n\t\t if ($green > $blue) Then\n\t\t\tSend(\"Q\")\n\t\t\tSleep(3000)\n\t\t Else\n\t\t\t$carryon = 0\n\t\t EndIf\n\t Else\n\t\t $carryon = 0\n\t EndIf\n Until ($carryon==0)\n \n ;Detect if less than 3 champion has energy\n Local $redtag = PixelGetColor(630,188)\n Local $red = BitShift($redtag, 16)\n Local $green = BitShift(BitAND($redtag, 0x00FF00), 8)\n Local $blue = BitAND($redtag, 0x0000FF)\n if (($red-80) > $green) Then\n\t if (($red-80) > $blue) Then\n\t\t MsgBox(0, \"Out of energy\", \"we're out of energy\", 2)\n\t\t $arena_continue = 0\n\t\t Sleep(4000)\n\t\t MouseClick(\"left\", 57, 55)\n\t\t if ($arena_tier==2) Then\n\t\t\t$arena_tier = 3\n\t\t Elseif ($arena_tier==3) Then\n\t\t\t$arena_tier = 2\n\t\t EndIf\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n ;Detect if there are any Reconnect popup\n if (PixelGetColor(490,320)==0x2b2c30) Then\n\t if (getDominantColor(PixelGetColor(490,350))==\"green\") Then\n\t\t MsgBox(0, \"popup\", \"I'll press the popup button in 5\", 5)\n\t\t Sleep(6000)\n\t\t MouseClick(\"left\", 490, 350)\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n ;detect if we're in useless milestone info\n if (getDominantColor(PixelGetColor(934,555))==\"green\") Then\n\t if ((PixelGetColor(492,337)==0x2b2c30)) Then\n\t\t MsgBox(0, \"milestone\", \"I assume we're in milestone info\", 1)\n\t\t Sleep(1000)\n\t\t $arena_continue = 0\n\t\t MouseClick(\"left\", 57, 55)\n\t\t Sleep(7000)\n\t EndIf\n EndIf\n \n \n ;if we're in continue next fight\n if (getDominantColor(PixelGetColor(936,556))==\"green\") Then\n\t if (PixelGetColor(688,436)==0x191e23) Then\n\t\t $arena_continue = 0\n\t\t fightArena()\n\t EndIf\n EndIf\nEndFunc\n\n;arena\nFunc addToTeam()\n MouseClickDrag(\"left\", 319, 235, 145, 135)\n sleep(500)\n MouseClickDrag(\"left\", 319, 235, 145, 210)\n sleep(500)\n MouseClickDrag(\"left\", 319, 235, 145, 290)\n sleep(500)\nEndFunc\n\n;Arena\nFunc findMatch()\n Sleep(500)\n MouseClick(\"left\", 109, 547)\n\t\t \n\t\t checkInsideFight()\n Sleep(4000)\n \n \n PixelSearch(543,416,575,429, 0x319732)\n if (@error) Then\n\t ;highest is not easy, check if mid easy\n\t PixelSearch(543,280,575,294, 0x319732)\n\t if (@error) Then\n\t\t ;mid is not easy\n\t\t MsgBox(0,\"tier\", \"mid and high is not easy\",1)\n\t\t MouseClick(\"left\", 600,200)\n\t Else\n\t\t ;mid is easy\n\t\t MouseClick(\"left\", 600,320)\n\t EndIf\n Else\n\t ;highest is easy\n\t MouseClick(\"left\", 687, 445)\n EndIf\n\t\t \n\t\t checkInsideFight()\n Sleep(3000)\n Send(\"0\")\n $c = PixelGetColor(841,574)\n if (GetDominantColor($c)==\"green\") Then\n\t Sleep(3000)\n Else\n\t Local $t = 0\n\t Local $cont = 1\n\t Do\n\t\t Sleep(500)\n\t\t if ($t>120) Then\n\t\t\t;stuck\n\t\t\t$cont = 0\n\t\t EndIf\n\t\t if (Not(PixelGetColor(841,574)==$c)) Then\n\t\t\t$cont = 0\n\t\t EndIf\n\t\t $t = $t+1\n\t Until ($cont==0)\n EndIf\nEndFunc\n\n;Fight in arena\nFunc fightArena()\n $seq = 0\n $stop = 0\n $allstop = 0\n \n ;stuck in something handler\n Local $somewhereoutsidecounter = 0\n Local $stuckseq = 0\n Local $startarena = TimerInit()\n Local $arenatimersecond = 0\n Do\n\t $stuckseq = $stuckseq+1\n\t if (Mod($stuckseq,400)==0) Then\n\t\t ;ToolTip(\"check stuck\")\n\t\t if (checkStuck()) Then\n\t\t\tupdateCapture()\n\t\t\t$stop = 1\n\t\t\tMsgBox(0, \"popup\", \"i guess we're stuck\", 2)\n\t\t\t\n\t\t\t;stuck in leaderboard\n\t\t\tif (PixelGetColor(921,138)==0x292c30) Then\n\t\t\t if (PixelGetColor(939,61)==0x6c6e71) Then\n\t\t\t\t MsgBox(0, \"popup\", \"leaderboard, ill close it\", 1)\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 939,61)\n\t\t\t\t Sleep(3000)\n\t\t\t EndIf\n\t\t\tEndIf\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\t\t\t\n\t\t\t\n\t\t\tSleep(10000)\n\t\t EndIf\n\t\t updateCapture()\n\t\t \n\t\t ;check if too long playing maybe something is not right\n\t\t Local $dif = TimerDiff($startarena)\n\t\t if ($dif > 30000) Then\n\t\t\t$startarena = TimerInit()\n\t\t\t$arenatimersecond = $dif\/1000\n\t\t EndIf\n\t\t if ($arenatimersecond > 240) Then\n\t\t\tMsgBox(0, \"popup\", \"too long minutes \", 3)\n\t\t\tSleep(5000)\n\t\t\tMouseClick(\"left\", 148, 58) ;menu\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 138, 58) ;menu double\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 270, 132) ;fight\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t Send(\"0\")\n\t Sleep(1);\n\t if (Mod($seq, 4)==0) Then\n\t\t Send(\"K\")\n\t EndIf\n\t $seq = $seq + 1\n\t if ($seq>15) then\n\t\t Send(\"{SPACE}\")\n\t\t if ($seq>20) Then\n\t\t\t$seq = 0\n\t\t EndIf\n\t EndIf\n\t if (getDominantColor(PixelGetColor(144,541))==\"red\") then\n\t\t Send(\"{SPACE}\")\n\t EndIf\n\t \n\t ;indicates fight has ended (loading screen)\n\t $loading = PixelGetColor(640, 540);\n\t if ($loading==0x025c00) Then\n\t\t $loading = PixelGetColor(620, 300)\n\t\t if ($loading==0x161a1b) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0, \"popup\", \"shall i press back button? (loading screen)\", 2)\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 57, 55); back because we might ended up in 3* 4* tier arena\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;or chat bar has been clicked\n\t if ($loading==0x161a1d) Then\n\t\t if (PixelGetColor(136,540)==0x292c30) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0,\"chat\", \"this is chat window\", 1)\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 943, 52); close\n\t\t\tSleep(2000)\n\t\t EndIf\n\t EndIf\n\t \n\t ; or the case if we ended up in view rewards\n\t $loading = PixelGetColor(480,270)\n\t if ($loading==0x2b2c30) Then\n\t\t $loading = PixelGetColor(480,330)\n\t\t if ($loading==0x2b2c30) Then\n\t\t\tMsgBox(0, \"popup\", \"(view rewards) ?(TODO)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(300)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\t;Sleep(10000)\n\t\t EndIf\n\t ElseIf ($loading==0x000000) Then\n\t\t ; stuck in alliance quest window; todo alliance quest window with empty quest\n\t\t if (PixelGetColor(838,366)==0x2b2c30) Then\n\t\t\t$stop = 1\n\t\t\tMsgBox(0,\"alliance q\", \"alliance quest cuy\", 1);\n\t\t\t;$arena_tier = 2\n\t\t\tSleep(2000)\n\t\t\tMouseClick(\"left\", 57, 55); \n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;stuck in alliance quest window\n\t $loading = PixelGetColor(384,142)\n\t if ($loading==0x1a1a1a) Then\n\t\t if (PixelGetColor(551,142)==0x1a1a1a) Then\n\t\t\tif (Not(PixelGetColor(504,142)==0x1a1a1a)) Then\n\t\t\t $stop = 1\n\t\t\t MsgBox(0,\"alliance q\", \"empty alliance quest cuy\", 1);\n\t\t\t ;$arena_tier = 2\n\t\t\t Sleep(2000)\n\t\t\t MouseClick(\"left\", 57, 55); \n\t\t\t Sleep(10000)\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t \n\t ;MsgBox(0, \"dbg\", StringFormat(\"%X\", PixelGetColor(18,130)), 1)\n\t ; or the case we stuck in team adding\n\t if (PixelGetColor(18, 130)==0x2b2c30) Then ; the left bar team list\n\t\t if (PixelGetColor(936,511)==0x2b2c30) Then ;the champion filter button\n\t\t\tMsgBox(0, \"popup\", \"(team adding)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t if (PixelGetColor(18, 130)==0x0b0b0c) Then ; the left bar team list\n\t\t if (PixelGetColor(936,511)==0x0b0b0c) Then ;the champion filter button\n\t\t\tMsgBox(0, \"popup\", \"(team adding dark)\", 2)\n\t\t\t$stop = 1\n\t\t\tSleep(1000)\n\t\t\tMouseClick(\"left\", 57, 55); back\n\t\t\tSleep(10000)\n\t\t EndIf\n\t EndIf\n\t \n\t ;or the case we're in somewhere outside (menu)\n\t if (PixelGetColor(955,50)==0x2b2c30) Then\n\t\t if (PixelGetColor(955, 562)==0x1d2630) Then\n\t\t\tif (Not(getDominantColor(PixelGetColor(936,556))==\"green\")) Then\n\t\t\t $somewhereoutsidecounter = $somewhereoutsidecounter+1\n\t\t\t if ($somewhereoutsidecounter>20) Then\n\t\t\t\t MsgBox(0, \"popup\", \"(somewhere outside for too long)\", 2)\n\t\t\t\t $stop = 1\n\t\t\t\t Sleep(1000)\n\t\t\t\t Send(\"J\")\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 138, 58) ;menu double\n\t\t\t\t Sleep(1000)\n\t\t\t\t MouseClick(\"left\", 270, 132) ;fight\n\t\t\t\t Sleep(5000)\n\t\t\t EndIf\n\t\t\tEndIf\n\t\t EndIf\n\t EndIf\n\t\t\t\n Until ($stop==1 or $allstop==1)\nEndFunc\n\n\n;FIGHT In quest\nFunc fight()\n $seq = 0\n $stop = 0\n $allstop = 0\n Do\n\t Send(\"0\")\n\t Sleep(30);\n\t $seq = $seq + 1\n\t if (Mod($seq, 4)==0) Then\n\t\t Send(\"K\")\n\t EndIf\n\t if ($seq>12) then\n\t\t Send(\"{SPACE}\")\n\t\t if ($seq>20) Then\n\t\t\t$seq = 0\n\t\t EndIf\n\t EndIf\n\t \n\t if (Mod($seq,2)==0) Then\n\t\t $loading = PixelGetColor(958, 577);\n\t\t if ($loading==0x1d2630) Then \n\t\t ;indicates fight has ended\n\t\t\t$loading = PixelGetColor(923, 491)\n\t\t\tif ($loading==0xc1c1c2) Then\n\t\t\t $stop = 1\n\t\t\t Sleep(3000)\n\t\t\t Send(\"J\")\n\t\t\tEndIf\n\t\t ElseIf ($loading==0x07090c) Then\n\t\t\tif (PixelGetColor(825,105)==0x2b2c30) Then\n\t\t\t $stop = 1\n\t\t\t Sleep(3000)\n\t\t\t Send(\"J\")\n\t\t\tEndIf\n\t\t ;Elseif (PixelGetColor(486,310)==0xeeeeee) Then\n\t\t\t;we're in loading screen\n\t\t\t;$stop = 1\n\t\t\t;Sleep(3000)\n\t\t\t;Send(\"J\")\n\t\t EndIf\n\t EndIf\n\t ;quest completed!\n\t Local $ca = PixelGetColor(204,190)\n\t if ($ca==0x2b2c30) Then\n\t\t Local $cb = PixelGetColor(739,514)\n\t\t\tif ($cb==0x2b2c30) Then\n\t\t\t if (getDominantColor(PixelGetColor(310,485))==\"green\" AND getDominantColor(PixelGetColor(741,485))==\"green\") Then\n\t\t\t\t $stop = 1\n\t\t\t\t Sleep(7000)\n\t\t\t\t MsgBox(0,\"finished\", \"finished\", 2)\n\t\t\t\t MouseClick(\"left\", 300,475);back to quest button\n\t\t\t\t Sleep(15000)\n\t\t\t\t \n\t\t\t\t MsgBox(0,\"arena\", \"my creator is away, i'll continue to arena to kill the time\",2)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 148, 58) ;menu\n\t\t\t\t Sleep(2000)\n\t\t\t\t MouseClick(\"left\", 270, 132) ;fight\n\t\t\t\t Sleep(15000)\n\t\t\t\t startArena()\n\t\t\t EndIf\n\t\t\tEndIf\n\t EndIf\n Until ($stop==1 or $allstop==1)\nEndFunc\n\n\nFunc nextNode()\n $allstop = 0\n Do\n\t Local $step = 0\n\t Do\n\t\t $step = $step + 1\n\t\t if ($step == 10) Then\n\t\t\tMouseClickDrag(\"left\", 450, 320, 642, 346)\n\t\t ElseIf ($step == 20) Then\n\t\t\tMouseClickDrag(\"left\", 450, 320, 200, 200)\n\t\t\tMouseClickDrag(\"left\", 450, 320, 300, 300)\n\t\t ElseIf ($step == 30) Then\n\t\t\tMouseClickDrag(\"left\", 700, 100, 100, 400)\n\t\t ElseIf ($step == 40) Then\n\t\t\tMouseClickDrag(\"left\", 100, 400, 700, 100)\n\t\t\tMouseClickDrag(\"left\", 100, 400, 700, 100)\n\t\t\t$step = 0\n\t\t EndIf\n\t\t Send(\"J\")\n\t\t Sleep(200)\n\t\t $greendot = PixelSearch(80,100, 957, 530, 0x00f800)\n\t\t if (@error) Then\n\t\t\t$greendot = PixelSearch(80,100, 957, 530, 0x00e400)\n\t\t EndIf\n\t Until not(@error)\n\t Send(\"J\")\n\t MouseMove($greendot[0], $greendot[1])\n\t MsgBox(0, \"now\", \"i will click this in 4s\", 1)\n\t Sleep(4000)\n\t MouseClick(\"left\", $greendot[0], $greendot[1])\n\t Sleep(500)\n\t MouseClick(\"left\", $greendot[0], $greendot[1])\n\t Sleep(10000)\n\t fight()\n\t Sleep(4000)\n\t Send(\"J\")\n Until ($allstop==1)\nEndFunc\n\nFunc getDominantColor($color)\n Local $red = BitShift($color, 16)\n Local $green = BitShift(BitAND($color, 0x00FF00), 8)\n Local $blue = BitAND($color, 0x0000FF)\n if ($red > $green And $red > $blue) Then\n\t Return (\"red\")\n ElseIf ($green > $blue And $green > $red) Then\n\t Return (\"green\")\n ElseIf ($blue > $red And $blue > $green) Then\n\t Return (\"blue\")\n Else\n\t if ($red > $green or $red > $blue) Then\n\t\t Return (\"red\")\n\t ElseIf ($green > $blue or $green > $red) Then\n\t\t Return (\"green\")\n\t Else\n\t\t Return (\"blue\")\n\t EndIf\n EndIf\nEndFunc\n\n;Calibrate the bluestack window position\n;@param $width the width of the screen to search\n;@param $height the height of the screen to search\nFunc calibrateWindow($width=1366,$height=768)\n ;searching bluestack logo\n Local $repeat = 1\n Do\n\t $icon = PixelSearch(0,0,1366,768, 0x79af1b);\n\t if (@error) Then\n\t\t MsgBox(0,\"failed\", \"can't find bluestack window\", 3)\n\t Else\n\t\t $find = PixelSearch($icon[0]-8, $icon[1], $icon[0]+8, $icon[1]+10, 0xf6d502)\n\t\t if (not(@error)) Then\n\t\t\t$find = PixelSearch($icon[0]-8,$icon[1], $icon[0]+8, $icon[1]+10, 0xdd3a17)\n\t\t\tif (not(@error)) Then\n\t\t\t MouseClickDrag(\"left\", $icon[0]+14, $icon[1], 30, 12)\n\t\t\t $repeat = 0\n\t\t\tEndIf\n\t\t EndIf\n\t\t ;next color\n\t EndIf\n\t \n Until ($repeat==0)\nEndFunc\n\n\n;perform check if we're stuck in a room (any current click affects nothing)\n;return True if stuck, False if not\nFunc checkStuck()\n ; check if we're stuck in some room\n $samepixel = 0\n if (Not(PixelGetColor(100,100)==$screensave[0])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(400,100)==$screensave[1])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(700,100)==$screensave[2])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(100,500)==$screensave[3])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(498,298)==$screensave[4])) Then\n\t Return False\n EndIf\n if (Not(PixelGetColor(700,500)==$screensave[5])) Then\n\t Return False\n EndIf\n Return True\nEndFunc\n\n;update $screensave to current capture\nFunc updateCapture()\n $screensave[0] = PixelGetColor(100,100)\n if ($screensave[0]==0x2a1a4c) Then ;we don't want to save loading screen;TODO REUPDATGE THESE\n\t $screensave[0] = 0\n EndIf\n $screensave[1] = PixelGetColor(400,100)\n if ($screensave[1]==0x201641) Then\n\t $screensave[1] = 0\n EndIf\n $screensave[2] = PixelGetColor(700,100)\n if ($screensave[2]==0x580e2f) Then\n\t $screensave[2] = 0\n EndIf\n $screensave[3] = PixelGetColor(100,500)\n if ($screensave[3]==0x2f1661) Then\n\t $screensave[3] = 0\n EndIf\n $screensave[4] = PixelGetColor(498,298)\n if ($screensave[4]==0x014cbe) Then\n\t $screensave[4] = 0\n EndIf\n $screensave[5] = PixelGetColor(700,500)\n if ($screensave[5]==0x7d1852) Then\n\t $screensave[5] = 0\n EndIf\nEndFunc\n\n\nFunc checkInsideFight()\n if (isInsideFight()) Then\n\t MsgBox(0,\"fight\", \"inside FIGHT!\",1)\n\t Sleep(500)\n\t MouseClick(\"left\",200,200)\n\t $arena_continue = 0\n\t fightArena()\n\t return 1\n Else\n\t return 0\n EndIf\nEndFunc\n;Check if currently in fight\n;return 1 if true, 0 false\nFunc isInsideFight()\n ;check if there is pause button\n Local $leftborder = 0\n Local $rightborder = 0\n $leftborder = PixelGetColor(466,57)\n $rightborder = PixelGetColor(511,57)\n if ($leftborder==0x222222 OR $leftborder==0x212121) Then\n\t if ($rightborder==0x222222 OR $rightborder==0x212121) Then\n\t\t if ((PixelGetColor(483,57)==0x9cba9b AND PixelGetColor(493,57)==0x9cba9b) AND getDominantColor(PixelGetColor(488,57))==\"green\") Then\n\t\t\treturn 1\n\t\t EndIf\n\t EndIf\n EndIf\n return 0\nEndFunc","returncode":0,"stderr":"","license":"mit","lang":"AutoIt"} {"commit":"f8d6d9521539438fee8537faf71bc22448a2bbf6","subject":"Cleanstring for messages","message":"Cleanstring for messages\n","repos":"MarceloSaied\/SubteBA","old_file":"udf\/CleanString.au3","new_file":"udf\/CleanString.au3","new_contents":"func clearstring($mensage)\n;~ ConsoleWrite('--(' & @ScriptName & '-' & @ScriptLineNumber & ') : $mensage = ' & $mensage & @crlf )\n;~ $mensage = StringReplace($mensage,\"(\",\"\")\n;~ $mensage = StringReplace($mensage,\")\",\"\")\n $mensage = StringReplace($mensage,\"'\",\"\")\n $mensage = StringReplace($mensage,\"\",\"\")\n $mensage = StringReplace($mensage,\"|\",\"\")\n $mensage = StringReplace($mensage,\"`\",\"\")\n $mensage = StringReplace($mensage,\"\",\"\")\n $mensage = _Latin_char_Remover($mensage)\n;~ \tConsoleWrite('+(' & @ScriptName & '-' & @ScriptLineNumber & ') : $mensage = ' & $mensage & @crlf )\n return $mensage\nEndFunc\n\nFunc _Latin_char_Remover($string_to_change)\n\n\t $string_to_change = StringReplace($string_to_change, '-', 'i')\n\t $string_to_change = StringReplace($string_to_change, '\u00ed', 'i')\n\t $string_to_change = StringReplace($string_to_change, '\u00fa', 'u')\n\t $string_to_change = StringReplace($string_to_change, 'i', 'u')\n\t $string_to_change = StringReplace($string_to_change, '\u00e9', 'e')\n;~ \t $string_to_change = StringReplace($string_to_change, '', 'i')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'a')\n\t $string_to_change = StringReplace($string_to_change, '', 'A')\n\t $string_to_change = StringReplace($string_to_change, '', 'A')\n\t $string_to_change = StringReplace($string_to_change, '', 'A')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'C')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'e')\n\t $string_to_change = StringReplace($string_to_change, '', 'E')\n\t $string_to_change = StringReplace($string_to_change, '', 'E')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'i')\n\t $string_to_change = StringReplace($string_to_change, '', 'I')\n\t $string_to_change = StringReplace($string_to_change, '', 'I')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'o')\n\t $string_to_change = StringReplace($string_to_change, '', 'O')\n\t $string_to_change = StringReplace($string_to_change, '', 'O')\n\t $string_to_change = StringReplace($string_to_change, '', 'O')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'u')\n\t $string_to_change = StringReplace($string_to_change, '', 'U')\n\t $string_to_change = StringReplace($string_to_change, '', 'U')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'Y')\n\n\t $string_to_change = StringReplace($string_to_change, '', 'n')\n\t $string_to_change = StringReplace($string_to_change, '', 'N')\n Return $string_to_change\nEndFunc ;==>_Latin_char_Remover","old_contents":"func clearstring($mensage)\n ;$mensage = StringReplace($mensage,\"(\",\"\")\n ;$mensage = StringReplace($mensage,\")\",\"\")\n $mensage = StringReplace($mensage,\"'\",\"\")\n $mensage = StringReplace($mensage,\"\",\"\")\n $mensage = StringReplace($mensage,\"|\",\"\")\n $mensage = StringReplace($mensage,\"`\",\"\")\n $mensage = StringReplace($mensage,\"\",\"\")\n $mensage = _Latin_char_Remover($mensage)\n return $mensage\nEndFunc\n\n\n\nFunc _Latin_char_Remover($string_to_change)\n\n\t$string_to_change = StringReplace($string_to_change, '', 'a')\n\t$string_to_change = StringReplace($string_to_change, '', 'A')\n $string_to_change = StringReplace($string_to_change, '', 'A')\n $string_to_change = StringReplace($string_to_change, '', 'A')\n\n $string_to_change = StringReplace($string_to_change, '', 'C')\n\n\t$string_to_change = StringReplace($string_to_change, '', 'e')\n $string_to_change = StringReplace($string_to_change, '', 'E')\n $string_to_change = StringReplace($string_to_change, '', 'E')\n\n\t$string_to_change = StringReplace($string_to_change, '', 'i')\n $string_to_change = StringReplace($string_to_change, '', 'I')\n $string_to_change = StringReplace($string_to_change, '', 'I')\n\n\t$string_to_change = StringReplace($string_to_change, '', 'o')\n $string_to_change = StringReplace($string_to_change, '', 'O')\n $string_to_change = StringReplace($string_to_change, '', 'O')\n $string_to_change = StringReplace($string_to_change, '', 'O')\n\n\t$string_to_change = StringReplace($string_to_change, '', 'u')\n $string_to_change = StringReplace($string_to_change, '', 'U')\n $string_to_change = StringReplace($string_to_change, '', 'U')\n\n $string_to_change = StringReplace($string_to_change, '', 'Y')\n\n\t\t$string_to_change = StringReplace($string_to_change, '', 'n')\n\t$string_to_change = StringReplace($string_to_change, '', 'N')\n Return $string_to_change\nEndFunc ;==>_Latin_char_Remover","returncode":0,"stderr":"","license":"mit","lang":"AutoIt"} {"commit":"ecd1da51738e7f5fa5abee584b430c3e8564354c","subject":"Modify the message about hotkey to stop.","message":"Modify the message about hotkey to stop.\n","repos":"hnakamur\/modern.ie.japanizer","old_file":"myprogress.au3","new_file":"myprogress.au3","new_contents":"#include \r\n\r\nGlobal $MyProgress_StepIndex = 0\r\nGlobal $MyProgress_StepCount = 100\r\nGlobal $MyProgress_MainText = \"\"\r\n\r\n; NOTE: $MyProgress_SubTextSuffix must be one line text.\r\nGlobal $MyProgress_SubTextSuffix = _\r\n\t\t\"Press alt+shift+x to stop if GUI automation goes wrong.\"\r\n\r\nFunc MyProgress_buildSubText($subtext)\r\n\tIf StringInStr($subtext, @CRLF) = 0 Then\r\n\t\tReturn $subtext & @CRLF & @CRLF & $MyProgress_SubTextSuffix\r\n\tElse\r\n\t\tReturn $subtext & @CRLF & $MyProgress_SubTextSuffix\r\n\tEndIf\r\nEndFunc ;==>MyProgress_buildSubText\r\n\r\n; NOTE: $subtext must be one or two lines.\r\nFunc MyProgress_On($title, $maintext, $subtext = \"\", $x = -1, $y = -1, $opt = -1)\r\n\tIf $opt = -1 Then\r\n\t\t$opt = $DLG_MOVEABLE\r\n\tEndIf\r\n\t$MyProgress_MainText = $maintext\r\n\tProgressOn($title, $maintext, MyProgress_buildSubText($subtext), $x, $y, $opt)\r\nEndFunc ;==>MyProgress_On\r\n\r\nFunc MyProgress_Step($subtext = \"\", $maintext = \"\")\r\n\t$MyProgress_StepIndex = $MyProgress_StepIndex + 1\r\n\tLocal $percent = 100 * $MyProgress_StepIndex \/ $MyProgress_StepCount\r\n\tIf $maintext <> \"\" Then\r\n\t\t$MyProgress_MainText = $maintext\r\n\tEndIf\r\n\tProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)\r\nEndFunc ;==>MyProgress_Step\r\n\r\nFunc MyProgress_Set($percent, $subtext = \"\", $maintext = \"\")\r\n\tIf $maintext <> \"\" Then\r\n\t\t$MyProgress_MainText = $maintext\r\n\tEndIf\r\n\tProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)\r\nEndFunc ;==>MyProgress_Set\r\n\r\nFunc MyProgress_Off()\r\n\tProgressOff()\r\nEndFunc ;==>MyProgress_Off\r\n","old_contents":"#include \r\n\r\nGlobal $MyProgress_StepIndex = 0\r\nGlobal $MyProgress_StepCount = 100\r\nGlobal $MyProgress_MainText = \"\"\r\n\r\n; NOTE: $MyProgress_SubTextSuffix must be one line text.\r\nGlobal $MyProgress_SubTextSuffix = _\r\n\t\t\"If GUI automation goes wrong, press ALT+SHIFT+x to stop.\"\r\n\r\nFunc MyProgress_buildSubText($subtext)\r\n\tIf StringInStr($subtext, @CRLF) = 0 Then\r\n\t\tReturn $subtext & @CRLF & @CRLF & $MyProgress_SubTextSuffix\r\n\tElse\r\n\t\tReturn $subtext & @CRLF & $MyProgress_SubTextSuffix\r\n\tEndIf\r\nEndFunc ;==>MyProgress_buildSubText\r\n\r\n; NOTE: $subtext must be one or two lines.\r\nFunc MyProgress_On($title, $maintext, $subtext = \"\", $x = -1, $y = -1, $opt = -1)\r\n\tIf $opt = -1 Then\r\n\t\t$opt = $DLG_MOVEABLE\r\n\tEndIf\r\n\t$MyProgress_MainText = $maintext\r\n\tProgressOn($title, $maintext, MyProgress_buildSubText($subtext), $x, $y, $opt)\r\nEndFunc ;==>MyProgress_On\r\n\r\nFunc MyProgress_Step($subtext = \"\", $maintext = \"\")\r\n\t$MyProgress_StepIndex = $MyProgress_StepIndex + 1\r\n\tLocal $percent = 100 * $MyProgress_StepIndex \/ $MyProgress_StepCount\r\n\tIf $maintext <> \"\" Then\r\n\t\t$MyProgress_MainText = $maintext\r\n\tEndIf\r\n\tProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)\r\nEndFunc ;==>MyProgress_Step\r\n\r\nFunc MyProgress_Set($percent, $subtext = \"\", $maintext = \"\")\r\n\tIf $maintext <> \"\" Then\r\n\t\t$MyProgress_MainText = $maintext\r\n\tEndIf\r\n\tProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)\r\nEndFunc ;==>MyProgress_Set\r\n\r\nFunc MyProgress_Off()\r\n\tProgressOff()\r\nEndFunc ;==>MyProgress_Off\r\n","returncode":0,"stderr":"","license":"mit","lang":"AutoIt"} {"commit":"d0ed2120762bafe4a2a2f639f4900b18b4e182c3","subject":"Changed installer window size to smaller.","message":"Changed installer window size to smaller.\n\n--HG--\nextra : convert_revision : svn%3A79c32731-664e-0410-8185-e51b9e89f9fb\/trunk%401136\n","repos":"userzimmermann\/robotframework-python3,userzimmermann\/robotframework-python3,userzimmermann\/robotframework-python3,Senseg\/robotframework,userzimmermann\/robotframework-python3,Senseg\/robotframework,Senseg\/robotframework,userzimmermann\/robotframework-python3,Senseg\/robotframework,Senseg\/robotframework","old_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_contents":";; Copyright 2008 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n$USAGE = \"One Click Installer installs Robot Framework and its \" & _\n \"preconditions Python and Jython (optional).\" & @CRLF & @CRLF & _\n \"Please specify the directory where you want software to be \" & _\n \"installed. Also make sure that you have required Robot Framework \" & _\n \"and Python installers, and optionally Jython installer, in the \" & _\n \"same directory as this installer.\" & @CRLF & @CRLF & _\n \"For more information see http:\/\/robotframework.org\/.\"\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot Framework\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $JYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 400, 250)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\" & $dir & \" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \" & $dir\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","old_contents":";; Copyright 2008 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n$USAGE = \"One Click Installer installs Robot Framework and its \" & _\n \"preconditions Python and Jython (optional).\" & @CRLF & @CRLF & _\n \"Please specify the directory where you want software to be \" & _\n \"installed. Also make sure that you have required Robot Framework \" & _\n \"and Python installers, and optionally Jython installer, in the \" & _\n \"same directory as this installer.\" & @CRLF & @CRLF & _\n \"For more information see http:\/\/robotframework.org\/.\"\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot Framework\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $JYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 500, 470)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\" & $dir & \" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \" & $dir\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"AutoIt"} {"commit":"88c58b56f2e5f325280878c42dce41c9b2fad066","subject":"Fixed bug that installation was not possible to path containing spaces.","message":"Fixed bug that installation was not possible to path containing spaces.\n\n--HG--\nextra : convert_revision : svn%3A79c32731-664e-0410-8185-e51b9e89f9fb\/trunk%402398\n","repos":"Senseg\/robotframework,userzimmermann\/robotframework-python3,Senseg\/robotframework,userzimmermann\/robotframework-python3,userzimmermann\/robotframework-python3,userzimmermann\/robotframework-python3,Senseg\/robotframework,Senseg\/robotframework,userzimmermann\/robotframework-python3,Senseg\/robotframework","old_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_contents":";; Copyright 2008-2009 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n$USAGE = \"One Click Installer installs Robot Framework and its \" & _\n \"preconditions Python and Jython (optional).\" & @CRLF & @CRLF & _\n \"Please specify the directory where you want software to be \" & _\n \"installed. Also make sure that you have required Robot Framework \" & _\n \"and Python installers, and optionally Jython installer, in the \" & _\n \"same directory as this installer.\" & @CRLF & @CRLF & _\n \"For more information see http:\/\/robotframework.org\/.\"\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot Framework\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $JYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 400, 250)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\"\"\" & $dir & \"\"\" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \"\"\" & $dir & \"\"\"\"\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","old_contents":";; Copyright 2008-2009 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n$USAGE = \"One Click Installer installs Robot Framework and its \" & _\n \"preconditions Python and Jython (optional).\" & @CRLF & @CRLF & _\n \"Please specify the directory where you want software to be \" & _\n \"installed. Also make sure that you have required Robot Framework \" & _\n \"and Python installers, and optionally Jython installer, in the \" & _\n \"same directory as this installer.\" & @CRLF & @CRLF & _\n \"For more information see http:\/\/robotframework.org\/.\"\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot Framework\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $JYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 400, 250)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\" & $dir & \" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \" & $dir\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"AutoIt"} {"commit":"0863914376cd159375a948490454375ed39bf9c1","subject":"updated usage","message":"updated usage\n","repos":"waldenner\/robotframework,ldtri0209\/robotframework,waldenner\/robotframework,fiuba08\/robotframework,fiuba08\/robotframework,ldtri0209\/robotframework,waldenner\/robotframework,fiuba08\/robotframework,waldenner\/robotframework,waldenner\/robotframework,fiuba08\/robotframework,fiuba08\/robotframework,ldtri0209\/robotframework,ldtri0209\/robotframework,ldtri0209\/robotframework","old_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_file":"tools\/oneclickinstaller\/RobotFrameworkOneClickInstaller.au3","new_contents":";; Copyright 2008 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n; Usage to show to the user. If major versions of installed software are changed update them also here!!\n; Patterns and directory names above are used in the usage so that they don't need to be updated.\n$USAGE = \"One Click Installer installs Robot Framework and its preconditions Python and Jython (optional). \" & _\n \"It also sets Robot Framework start-up scripts (pybot, jybot, rebot) as well as Python and Jython executables \" & _\n \"into %PATH% environment variable so that they can be executed from the command line. (Note that \" & _\n \"you need to restart the command prompt for these changes to take effect.)\" & @CRLF & @CRLF & _\n \"You should use this installer ONLY if you do not previously have Python or Jython installed. \" & _\n \"In that case, and also if you want to have a custom installation, you need to install needed \" & _\n \"components separately.\" & @CRLF & @CRLF & _\n \"One Click Installer requires that you have all the required component installers in the same directory \" & _\n \"with it and that they have expected names. If Robot Framework or Python installer is missing, \" & _\n \"installation fails. If Jython installer does not exist, Jython is simply not installed. Note that \" & _\n \"in order to install Jython, Java 1.4 or newer must be already installed. Minimum supported versions \" & _\n \"are Robot Framework 2.0, Python 2.5 and Jython 2.2, but newer versiosn are always recommened. These \" & _\n \"installers can be downloaded from respective project websites. Expected patterns for installer names are '\" & _\n $ROBOT_PATTERN & \"', '\" & $PYTHON_PATTERN & \"' and '\" & $JYTHON_PATTERN & \"'.\" & @CRLF & @CRLF & _\n \"The only thing you need to specify is the base directory where to install Python and Jython. \" & _\n \"They are installed into directories '\" & $PYTHON_DIR_NAME & \"' and '\" & $JYTHON_DIR_NAME & \"', \" & _\n \"respectively, inside the given base directory. Robot Framework itself is installed under Python \" & _\n \"installation directory and its startup scripts can be found from '[PYTHON]\\Scripts' and code from \" & _ \n \"'[PYTHON]\\Lib\\site-packages'.\" & @CRLF & @CRLF & _\n \"Note that the specified base directory MUST exist and Python and Jython directories inside it must not. \" & _\n \"It is also not recommended to use a path containing spaces. Good candidates include directories like \" & _\n \"'C:\\' and 'C:\\APPS'.\"\n\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $PYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 500, 470)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\" & $dir & \" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \" & $dir\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","old_contents":";; Copyright 2008 Nokia Siemens Networks Oyj\n;;\n;; Licensed under the Apache License, Version 2.0 (the \"License\");\n;; you may not use this file except in compliance with the License.\n;; You may obtain a copy of the License at\n;;\n;; http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n;;\n;; Unless required by applicable law or agreed to in writing, software\n;; distributed under the License is distributed on an \"AS IS\" BASIS,\n;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n;; See the License for the specific language governing permissions and\n;; limitations under the License.\n\n\n;; Robot Framework One Click Installer for Windows\n;;\n;; This installer installs Robot Framework and its preconditions Python and \n;; Jython (optional). If installer is executed without arguments, it opens a \n;; dialog explaining the options and asking the user to enter the installation\n;; directory. If a command line options is given, it must be a path to an \n;; existing directory and it is used as installation directory.\n;;\n;; For more information about this script see $USAGE below. To learn more \n;; about silent Python installation, see url [1]. Silent Jython installation \n;; options can be seen with command [2].\n;;\n;; [1] http:\/\/www.python.org\/download\/releases\/2.5\/msi\/#automated\n;; [2] java -jar jython_installer-2.2.x.jar --help\n\n\n;;\n;; Config\n;;\n\n; Expected patterns for installer names and target directory names.\n$PYTHON_DIR_NAME = \"Python\"\n$JYTHON_DIR_NAME = \"Jython\"\n$PYTHON_PATTERN = \"python-2.*.msi\"\n$ROBOT_PATTERN = \"robotframework-2.*.exe\"\n$JYTHON_PATTERN = \"jython_installer-2.*.jar\"\n\n; Usage to show to the user. If major versions of installed software are changed update them also here!!\n; Patterns and directory names above are used in the usage so that they don't need to be updated.\n$USAGE = \"One Click Installer installs Robot Framework and its preconditions Python and Jython (optional). \" & _\n \"It also sets Robot Framework start-up scripts (pybot, jybot, rebot) as well as Python and Jython executables \" & _\n \"into %PATH% environment variable so that they can be executed from the command line. (Note that \" & _\n \"you need to restart the command prompt for these changes to take effect.)\" & @CRLF & @CRLF & _\n \"You should use this installer ONLY if you don't previously have Python or Jython installed. \" & _\n \"In that case, and also if you want to have a custom installation, you need to install needed \" & _\n \"components separately.\" & @CRLF & @CRLF & _\n \"One Click Installer requires that you have all the required component installers in the same directory \" & _\n \"with it and that they have expected names. If Robot Framework or Python installer is missing, \" & _\n \"installation fails. If Jython installer doesn't exist, Jython is simply not installed. Note that \" & _\n \"in order to install Jython, Java 1.4 or newer must be already installed. Supported \" & _\n \"versions are Robot Framework 2.x, Python 2.5.x and Jython 2.2.x where '.x' means that any minor version \" & _\n \"(e.g. 2.5 or 2.5.2) is OK. These installers can be downloaded from respective project websites if \" & _\n \"they are missing. Expected patterns for installer names are '\" & $ROBOT_PATTERN & \"', '\" & _\n $PYTHON_PATTERN & \"' and '\" & $JYTHON_PATTERN & \"'.\" & @CRLF & @CRLF & _\n \"The only thing you need to specify is the base directory where to install Python and Jython. \" & _\n \"They are installed into directories '\" & $PYTHON_DIR_NAME & \"' and '\" & $JYTHON_DIR_NAME & \"', \" & _\n \"respectively, inside the given base directory. Robot Framework itself is installed under Python \" & _\n \"installation directory and its startup scripts can be found from '[PYTHON]\\Scripts' and code from \" & _ \n \"'[PYTHON]\\Lib\\site-packages'.\" & @CRLF & @CRLF & _\n \"Note that the specified base directory MUST exist and Python and Jython directories inside it must not. \" & _\n \"It is also not recommended to use a path containing spaces. Good candidates include directories like \" & _\n \"'C:\\' and 'C:\\APPS'.\"\n\n\n;;\n;; Main\n;;\n\n$base_dir = GetBaseDirectory()\n$python_installer = GetRequiredInstaller($PYTHON_PATTERN, \"Python\")\n$robot_installer = GetRequiredInstaller($ROBOT_PATTERN, \"Robot\")\n$jython_installer = GetOptionalInstaller($JYTHON_PATTERN)\n$python_dir = GetPythonDir($base_dir & $PYTHON_DIR_NAME)\n$jython_dir = GetJythonDir($base_dir & $PYTHON_DIR_NAME, $jython_installer)\nInstallPython($python_installer, $python_dir)\nInstallJython($jython_installer, $jython_dir)\nSetPath($python_dir, $jython_dir) ; This must be done before InstallRobot to always have msvcrt71.dll in PATH\nInstallRobot($robot_installer)\nExit\n\n\n;;\n;; Functions\n;;\n\nFunc GetBaseDirectory()\n If $CmdLine[0] == 0 Then\n $base = InputBox(\"Robot Framework One Click Installer\", $USAGE, \"C:\\\", \"\", 500, 470)\n ElseIf $CmdLine[0] == 1 Then\n $base = $CmdLine[1]\n Else\n Cancel(\"Usage: \" & @ScriptName & \" [basedir]\")\n EndIf\n If $base == \"\" Then\n Cancel(\"Installation cancelled by user.\")\n ElseIf FileExists($base) == 0 Then\n Cancel(\"Given directory doesn't exist.\")\n ElseIf StringRight($base, 1) <> \"\\\" Then\n $base = $base & \"\\\"\n EndIf\n Return $base\nEndFunc\n\n\nFunc Cancel($msg)\n MsgBox(0, \"Installation Cancelled\", $msg)\n Exit\nEndFunc\n\n\nFunc GetRequiredInstaller($pattern, $name)\n $installer = GetOptionalInstaller($pattern)\n If $installer == \"\" Then\n Cancel(\"Could not find \" & $name & \" installer with pattern '\" & $pattern & \"'\")\n Endif\n return $installer\nEndFunc\n\n\nFunc GetOptionalInstaller($pattern)\n $found = FileFindFirstFile($pattern)\n If $found == -1 Then\n $installer = \"\"\n Else \n $installer = FileFindNextFile($found)\n EndIf\n FileClose($found)\n return $installer\nEndFunc\n\n\nFunc GetPythonDir($dir)\n VerifyInstallationDir($dir, \"Python\")\n return $dir\nEndFunc\n\n\nFunc GetJythonDir($dir, $installer)\n If $installer == \"\" Then\n return \"\"\n EndIf\n VerifyInstallationDir($dir, \"Jython\")\n return $dir\nEndFunc\n\n\nFunc VerifyInstallationDir($dir, $name)\n If FileExists($dir) == 1 Then\n Cancel($name & \" installation directory '\" & $dir & \"' already exists.\")\n EndIf\nEndFunc\n\n\nFunc InstallPython($installer, $dir)\n $cmd = \"msiexec \/i \" & $installer & \" TARGETDIR=\" & $dir & \" \/qb!\" \n RunWait($cmd) \nEndFunc\n\n\nFunc InstallJython($installer, $dir)\n If $installer == \"\" Then\n return\n EndIf\n $cmd = \"java -jar \" & $installer & \" -s -d \" & $dir\n RunWait($cmd)\nEndFunc\n\n\nFunc InstallRobot($installer)\n Run($installer)\n WaitSetupWindowAndClickEnter(\"This Wizard will install\")\n WaitSetupWindowAndClickEnter(\"Select python installation\")\n WaitSetupWindowAndClickEnter(\"Ready to install\")\n WaitSetupWindowAndClickEnter(\"Postinstall script finished\")\nEndFunc\n\n\nFunc WaitSetupWindowAndClickEnter($exp_text)\n WinWaitActive(\"Setup\", $exp_text) \n Send(\"{ENTER}\")\nEndFunc\n\n\nFunc SetPath($python, $jython)\n $update = $python & \";\" & $python & \"\\Scripts;\" & $jython\n $orig = RegRead(\"HKCU\\Environment\", \"PATH\")\n\n If $orig == \"\" Then\n $new = $update\n ElseIf StringRight($orig, 1) == \";\" Then\n $new = $orig & $update\n Else\n $new = $orig & \";\" & $update\n EndIf\n \n RegWrite(\"HKCU\\Environment\", \"PATH\", \"REG_EXPAND_SZ\", $new)\n EnvUpdate()\nEndFunc\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"AutoIt"} {"commit":"7bffc7464ac418c1f4c2de1f4372391d0baf6060","subject":"Update Angulos.au3","message":"Update Angulos.au3","repos":"chechelaky\/AutoIt,chechelaky\/AutoIt,chechelaky\/AutoIt,chechelaky\/AutoIt","old_file":"Diversos\/Angulos\/Angulos.au3","new_file":"Diversos\/Angulos\/Angulos.au3","new_contents":";~ #AutoIt3Wrapper_AU3Check_Parameters= -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7\n;~ #Tidy_Parameters=\/sf\n\n; #SCRIPT# =====================================================================================================================\n; Name ..........: Angulos\n; Description ...: Um script que demonstra visualmente onde como \u00e9 representado os componentes de um \u00e2ngulo (sen, cos, tan...)\n; Author ........: Luigi (Luismar Chechelaky)\n; Link ..........: https:\/\/github.com\/chechelaky\/AutoIt\/blob\/master\/Diversos\/Angulos\/Angulos.au3\n; ===============================================================================================================================\n\n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n#include \n\nOpt(\"GUIOnEventMode\", 1)\nOpt(\"GUIEventOptions\", 1)\nOpt(\"MustDeclareVars\", 1)\n\nGlobal $RAIO = 100\nGlobal $hGui, $hMsg, $active = True\nGlobal $hGraphic, $hPen1, $hPen2, $hPen3, $hPen4, $hPen5, $hBitmap, $hBackbuffer, $hCursor, $mouse[4], $xx2, $yy2\n\nGlobal $largura = 800, $altura = 600, $limites[6]\n\nGlobal Const $PI = 3.1415926535897932384626433832795\nGlobal Const $radToDeg = 180 \/ $PI\n\n$hGui = GUICreate(\"\u00c2ngulos\", $largura, $altura)\nGUISetOnEvent($GUI_EVENT_CLOSE, \"Quit\", $hGui)\nGlobal $hSeno = GUICtrlCreateCheckbox(\"Seno\", 10, 5, 80, 20)\nGUICtrlSetOnEvent($hSeno, \"Show_Seno\")\n\nGlobal $hCos = GUICtrlCreateCheckbox(\"Cosseno\", 10, 25, 80, 20)\nGUICtrlSetOnEvent($hCos, \"Show_Cos\")\n\nGlobal $hTan = GUICtrlCreateCheckbox(\"Tangente\", 100, 5, 80, 20)\nGUICtrlSetOnEvent($hTan, \"Show_Tan\")\n\nGlobal $hCot = GUICtrlCreateCheckbox(\"Cotangente\", 100, 25, 80, 20)\nGUICtrlSetOnEvent($hCot, \"Show_Cot\")\n\nGlobal $hSec = GUICtrlCreateCheckbox(\"Secante\", 190, 5, 80, 20)\nGUICtrlSetOnEvent($hSec, \"Show_Sec\")\n\nGlobal $hCosec = GUICtrlCreateCheckbox(\"Co-Sec\", 190, 25, 80, 20)\nGUICtrlSetOnEvent($hCosec, \"Show_Cosec\")\n\nGlobal $hPasso = GUICtrlCreateCombo(\"\", 270, 5, 80, 20, $CBS_DROPDOWNLIST)\nGUICtrlSetData($hPasso, \"Livre|1|5|10|15|30\", \"Livre\")\n\nGlobal $hInvertido = GUICtrlCreateCheckbox(\"Inverso\", 360, 5, 80, 20)\nGUICtrlSetOnEvent($hInvertido, \"Show_Inverso\")\n\nGlobal $hDxDy = GUICtrlCreateCheckbox(\"DxDy\", 360, 25, 80, 20)\nGUICtrlSetOnEvent($hDxDy, \"Show_DxDy\")\n\nGlobal $hPontoOrigem = GUICtrlCreateCheckbox(\"Origem\", 450, 5, 80, 20)\nGUICtrlSetOnEvent($hPontoOrigem, \"Show_Origem\")\nGlobal $hPontoCartesiano = GUICtrlCreateCheckbox(\"Cartesiano\", 450, 25, 80, 20)\nGUICtrlSetOnEvent($hPontoCartesiano, \"Show_Cartesiano\")\n\nGUICtrlCreateLabel(\"Raio\", 540, 5, 80, 20)\nGlobal $iInputRaio = GUICtrlCreateInput($RAIO, 540, 25, 80, 20, $ES_NUMBER)\nGlobal $hInputRaio = GUICtrlGetHandle($iInputRaio)\n\nGlobal $iSeno = False, $iCos = False, $iTan = False, $iCot = False, $iSec = False, $iCoSec = False, $iInverso = False, $bOrigem = False, $bCartesiano = False, $bDxDy = False\nGUISetState(@SW_SHOWNORMAL)\nGUIRegisterMsg($WM_COMMAND, \"WM_COMMAND\")\n\n_GDIPlus_Startup()\n$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)\n$hBitmap = _GDIPlus_BitmapCreateFromGraphics($largura - 20, $altura - 60, $hGraphic)\n\n_limites()\n\n\n$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)\n\n$hPen1 = _GDIPlus_PenCreate()\n$hPen2 = _GDIPlus_PenCreate(0xFFFF0000, 3)\n$hPen3 = _GDIPlus_PenCreate(0xFF339966)\n$hPen4 = _GDIPlus_PenCreate(0xFF0000FF)\n$hPen5 = _GDIPlus_PenCreate(0xFF3366FF)\n_GDIPlus_GraphicsClear($hBackbuffer)\n_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)\n\nGlobal $hBrush_01 = _GDIPlus_BrushCreateSolid(0xFF336699)\nGlobal $hBrush_02 = _GDIPlus_BrushCreateSolid(0xFFFF0000)\nGlobal $hBrush_03 = _GDIPlus_BrushCreateSolid(0xFF339966)\nGlobal $hBrush_04 = _GDIPlus_BrushCreateSolid(0xFF3366FF)\nGlobal $hFamily = _GDIPlus_FontFamilyCreate(\"Courier New\")\nGlobal $hFont = _GDIPlus_FontCreate($hFamily, 10)\nGlobal $hFont2 = _GDIPlus_FontCreate($hFamily, 25)\nGlobal $hPosX = _GDIPlus_RectFCreate(2, 0, 120, 15)\nGlobal $hPosY = _GDIPlus_RectFCreate(2, 20, 120, 15)\nGlobal $hAng = _GDIPlus_RectFCreate(600, 400, 180, 30)\nGlobal $hInv = _GDIPlus_RectFCreate(2, 100, 120, 15)\n\nGlobal $hPosX1 = _GDIPlus_RectFCreate(2, 40, 120, 15)\nGlobal $hPosY1 = _GDIPlus_RectFCreate(2, 60, 120, 15)\n\nGlobal $hPosX2 = _GDIPlus_RectFCreate(2, 120, 120, 15)\nGlobal $hPosY2 = _GDIPlus_RectFCreate(2, 140, 120, 15)\n\nGlobal $hStringFormat = _GDIPlus_StringFormatCreate()\n\nGlobal $start = TimerInit()\n\nWhile Sleep(10)\n\t$hMsg = GUIGetMsg()\n\n\t$hCursor = GUIGetCursorInfo()\n\tIf IsArray($hCursor) Then\n\t\t$mouse[0] = $hCursor[0] - $limites[0]\n\t\t$mouse[1] = $hCursor[1] - $limites[1]\n\tEndIf\n\n\tIf WinActive($hGui) Then\n\t\tIf Not $active Then $active = True\n\t\tIf TimerDiff($start) >= 10 Then\n\t\t\tUpdate()\n\t\t\t$start = TimerInit()\n\t\tEndIf\n\tElseIf Not WinActive($hGui) And $active Then\n\t\t$active = False\n\tEndIf\nWEnd\n\nFunc Update()\n\t_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)\n\tIf $bCartesiano Then\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"x[\" & $mouse[0] & \"]\", $hFont, $hPosX, $hStringFormat, $hBrush_01)\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"y[\" & $mouse[1] & \"]\", $hFont, $hPosY, $hStringFormat, $hBrush_01)\n\tEndIf\n\tIf $bOrigem Then\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"x[\" & $mouse[0] - 389 & \"]\", $hFont, $hPosX1, $hStringFormat, $hBrush_02)\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"y[\" & - ($mouse[1] - 270) & \"]\", $hFont, $hPosY1, $hStringFormat, $hBrush_02)\n\tEndIf\n\n\tLocal $ang = Angulo(0, 0, $mouse[0] - 389, -($mouse[1] - 270))\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, StringFormat(\"%.2f\", $ang[0]) & \"\u00ba\", $hFont2, $hAng, $hStringFormat, $hBrush_03)\n\n\t_box($hBackbuffer, 0, 0, $largura - 21, $altura - 61)\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) \/ 2, 0, ($largura - 21) \/ 2, $altura - 60, $hPen1)\n\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 0, ($altura - 60) \/ 2, $largura - 21, ($altura - 60) \/ 2, $hPen1)\n\t_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) \/ 2 - $RAIO - 1, ($altura - 60) \/ 2 - $RAIO, $RAIO * 2, $RAIO * 2)\n;~ \t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) \/ 2, ($altura - 60) \/ 2, $mouse[0], $mouse[1], $hPen2)\n\tLocal $cos = Int($RAIO * Cos(($ang[0] \/ 180) * $PI))\n\tLocal $sen = Int($RAIO * Sin(($ang[0] \/ 180) * $PI))\n\tLocal $tan = Int($RAIO * ($sen \/ $cos))\n\tLocal $cot = Int($RAIO * ($cos \/ $sen))\n\tLocal $sec = Int($RAIO * (1 \/ (Cos(($ang[0] \/ 180) * $PI))))\n\tLocal $cosec = Int($RAIO * (1 \/ (Sin(($ang[0] \/ 180) * $PI))))\n\n\tIf $bDxDy Then\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"Dx[\" & StringFormat(\"%.2f\", Cos(($ang[0] \/ 180) * $PI) * $RAIO) & \"]\", $hFont, $hPosX2, $hStringFormat, $hBrush_02)\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"Dy[\" & StringFormat(\"%.2f\", Sin(($ang[0] \/ 180) * $PI) * $RAIO) & \"]\", $hFont, $hPosY2, $hStringFormat, $hBrush_02)\n\tEndIf\n\n\t_GDIPlus_GraphicsDrawPie($hBackbuffer, ($largura - 20) \/ 2 - 1 - 25, ($altura - 60) \/ 2 - 25, 50, 50, 0, -$ang[0])\n\n\tIf $iSeno Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389, 270 - $sen, $hPen2)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389, 270 - $sen, $hPen1)\n\tEndIf\n\n\tIf $iCos Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 + $cos, 270, $hPen2)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen1)\n\tEndIf\n\n\tIf $iTan Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 - $RAIO, 1, 389 - $RAIO, 538, $hPen1)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, $RAIO + 389, 1, $RAIO + 389, 538, $hPen1)\n\t\tIf $cos > 0 Then\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, $RAIO + 389, 270 - $tan, $RAIO + 389, 270, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, $RAIO + 389, 270 - $tan, $hPen1)\n\t\tElse\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 - $RAIO, 270 + $tan, 389 - $RAIO, 270, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 - $RAIO, 270 + $tan, $hPen1)\n\t\tEndIf\n\tEndIf\n\n\tIf $iCot Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 270 - $RAIO, 778, 270 - $RAIO, $hPen1)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 270 + $RAIO, 778, 270 + $RAIO, $hPen1)\n\t\tIf $sen > 0 Then\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, 270 - $RAIO, ($largura - 20) \/ 2 - 1 + $cot, 270 - $RAIO, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) \/ 2 - 1 + $cot, 270 - $RAIO, $hPen1)\n\t\tElse\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, 270 + $RAIO, ($largura - 20) \/ 2 - 1 - $cot, 270 + $RAIO, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) \/ 2 - 1 - $cot, 270 + $RAIO, $hPen1)\n\t\tEndIf\n\tEndIf\n\n\tIf $iSec Then\n\t\tLocal $resposta = \"\"\n\t\tSelect\n\t\t\tCase $ang[0] == 0 Or $ang[0] = 360\n\t\t\t\t$resposta = \"#1 secante[n\u00e3o existe]\"\n\t\t\tCase $ang[0] > 0 And $ang[0] < 90\n\t\t\t\t$resposta = \"#2 secante[\" & $ang[0] & \"] angulo[\" & 90 + $ang[0] & \"]\"\n\t\t\tCase $ang[0] == 90 Or $ang[0] == 180\n\t\t\t\t$resposta = \"#3 secante[n\u00e3o existe]\"\n\t\t\tCase $ang[0] > 90 And $ang[0] < 180\n\t\t\t\t$resposta = \"#4 secante[\" & $ang[0] & \"] angulo[\" & $ang[0] - 90 & \"]\"\n\t\t\tCase $ang[0] > 180 And $ang[0] < 270\n\t\t\t\t$resposta = \"#5 secante[\" & $ang[0] & \"]\"\n\t\t\tCase $ang[0] > 270 And $ang[0] < 360\n\t\t\t\t$resposta = \"#6 secante[\" & $ang[0] & \"]\"\n\t\tEndSelect\n\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $sec, 270, 389, 270, $hPen2)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $sec, 270, 389, 270 - $cosec, $hPen4)\n\tEndIf\n\n\tIf $iCoSec Then\n\t\tLocal $resposta = \"\"\n\t\tSelect\n\t\t\tCase $ang[0] == 0 Or $ang[0] = 360\n\t\t\t\t$resposta = \"#1 secante[n\u00e3o existe]\"\n\t\t\tCase $ang[0] > 0 And $ang[0] < 90\n\t\t\t\t$resposta = \"#2 secante[\" & $ang[0] & \"] angulo[\" & 90 + $ang[0] & \"]\"\n\t\t\tCase $ang[0] == 90 Or $ang[0] == 180\n\t\t\t\t$resposta = \"#3 secante[n\u00e3o existe]\"\n\t\t\tCase $ang[0] > 90 And $ang[0] < 180\n\t\t\t\t$resposta = \"#4 secante[\" & $ang[0] & \"] angulo[\" & $ang[0] - 90 & \"]\"\n\t\t\tCase $ang[0] > 180 And $ang[0] < 270\n\t\t\t\t$resposta = \"#5 secante[\" & $ang[0] & \"]\"\n\t\t\tCase $ang[0] > 270 And $ang[0] < 360\n\t\t\t\t$resposta = \"#6 secante[\" & $ang[0] & \"]\"\n\t\tEndSelect\n\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $sec, 270, 389, 270 - $cosec, $hPen4)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389, 270, 389, 270 - $cosec, $hPen2)\n\tEndIf\n\n\tIf $iInverso Then\n\t\tLocal $invertido = $ang[0] > 180 ? $ang[0] - 180 : 180 + $ang[0]\n\t\t$invertido = $invertido = 360 ? 0 : $invertido\n\t\t$invertido = StringFormat(\"%.2f\", $invertido)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 - $cos, 270 + $sen, $hPen5)\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, \"\u00ba[\" & $invertido & \"]\", $hFont, $hInv, $hStringFormat, $hBrush_04)\n\tEndIf\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 + $cos, 270 - $sen, $hPen3)\n\n\t_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 10, 50, $largura - 20, $altura - 60)\nEndFunc ;==>Update\n\nFunc Quit()\n\n\t_GDIPlus_BrushDispose($hBrush_01)\n\t_GDIPlus_BrushDispose($hBrush_02)\n\t_GDIPlus_BrushDispose($hBrush_03)\n\t_GDIPlus_BrushDispose($hBrush_04)\n\t_GDIPlus_FontFamilyDispose($hFamily)\n\t_GDIPlus_FontDispose($hFont)\n\t_GDIPlus_FontDispose($hFont2)\n\t_GDIPlus_StringFormatDispose($hStringFormat)\n\n\t_GDIPlus_GraphicsDispose($hBackbuffer)\n\t_GDIPlus_BitmapDispose($hBitmap)\n\t_GDIPlus_PenDispose($hPen1)\n\t_GDIPlus_PenDispose($hPen2)\n\t_GDIPlus_PenDispose($hPen3)\n\t_GDIPlus_PenDispose($hPen4)\n\t_GDIPlus_PenDispose($hPen5)\n\t_GDIPlus_GraphicsDispose($hGraphic)\n\t_GDIPlus_Shutdown()\n\tExit\nEndFunc ;==>Quit\n\nFunc _box($hToGraphic, $ix1, $iy1, $il, $ia)\n\tLocal $aBox[5][2]\n\t$aBox[0][0] = 4\n\t$aBox[1][0] = $ix1\n\t$aBox[1][1] = $iy1\n\t$aBox[2][0] = $ix1 + $il\n\t$aBox[2][1] = $iy1\n\t$aBox[3][0] = $ix1 + $il\n\t$aBox[3][1] = $iy1 + $ia\n\t$aBox[4][0] = $ix1\n\t$aBox[4][1] = $iy1 + $ia\n\t_GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox)\nEndFunc ;==>_box\n\nFunc Angulo($xx1, $yy1, $xx2, $yy2)\n\tLocal $arr[2], $ca = Abs($yy2 - $yy1), $co = Abs($xx2 - $xx1)\n\tSelect\n\t\tCase $xx1 > $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = ATan(($co) \/ ($ca)) * $radToDeg + 90\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 180\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = 270 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\tEndSelect\n\t\tCase $xx1 == $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = 90\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 0\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = 270\n\t\t\tEndSelect\n\t\tCase $xx1 < $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = 90 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 0\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = ATan(($co) \/ ($ca)) * $radToDeg + 270\n\t\t\t\t\t;$arr[0] = 270 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\tEndSelect\n\tEndSelect\n\t$arr[0] = StringFormat(\"%.2f\", $arr[0])\n\t$arr[1] = Sqrt($co ^ 2 + $ca ^ 2)\n\tReturn $arr\nEndFunc ;==>Angulo\n\nFunc Show_Origem()\n\t$bOrigem = Not $bOrigem\nEndFunc ;==>Show_Origem\n\nFunc Show_Cartesiano()\n\t$bCartesiano = Not $bCartesiano\nEndFunc ;==>Show_Cartesiano\n\nFunc Show_Inverso()\n\t$iInverso = Not $iInverso\nEndFunc ;==>Show_Inverso\n\nFunc Show_Seno()\n\t$iSeno = Not $iSeno\nEndFunc ;==>Show_Seno\n\nFunc Show_Cos()\n\t$iCos = Not $iCos\nEndFunc ;==>Show_Cos\n\nFunc Show_Tan()\n\t$iTan = Not $iTan\nEndFunc ;==>Show_Tan\n\nFunc Show_Cot()\n\t$iCot = Not $iCot\nEndFunc ;==>Show_Cot\n\nFunc Show_Sec()\n\t$iSec = Not $iSec\nEndFunc ;==>Show_Sec\n\nFunc Show_Cosec()\n\t$iCoSec = Not $iCoSec\nEndFunc ;==>Show_Cosec\n\nFunc Show_DxDy()\n\t$bDxDy = Not $bDxDy\nEndFunc ;==>Show_DxDy\n\nFunc _limites()\n\t$limites[0] = 10\n\t$limites[1] = 50\n\t$limites[2] = $largura - 20\n\t$limites[3] = $altura - 50\n\t$limites[4] = ($largura - 20) \/ 2\n\t$limites[5] = ($altura - 50) \/ 2\n\t;_ArrayDisplay($limites)\nEndFunc ;==>_limites\n\nFunc WM_COMMAND($hWnd, $imsg, $iwParam, $ilParam)\n\tLocal $setHK = False\n\tLocal $nNotifyCode = BitShift($iwParam, 16)\n;~ Local $nID = BitAND($iwParam, 0x0000FFFF)\n;~ Local $hCtrl = $ilParam\n\n\tIf $nNotifyCode = $EN_CHANGE Then\n\t\tIf $ilParam = $hInputRaio Then\n\t\t\t$RAIO = GUICtrlRead($iInputRaio)\n\t\tEndIf\n\tEndIf\n\tReturn $GUI_RUNDEFMSG\nEndFunc ;==>WM_COMMAND\n","old_contents":"; http:\/\/www.brasilescola.com\/matematica\/secante-cosecante-cotangente.htm\n; http:\/\/eduardo-vasconcelos.blogspot.com.br\/2012\/01\/trigonometria-05-funcao-secante.html\n#include \n#include \n#include \n#include \n#include \n\n; #SCRIPT# =====================================================================================================================\n; Name ..........: Angulos\n; Description ...: Um script que demonstra visualmente onde como \u00e9 representado os componentes de um \u00e2ngulo (sen, cos, tan...)\n; Author ........: Luigi (Luismar Chechelaky)\n; Link ..........: https:\/\/github.com\/chechelaky\/AutoIt\/blob\/master\/Diversos\/Angulos\/Angulos.au3\n; ===============================================================================================================================\n\nGlobal $hGui, $hMsg, $active = True\nGlobal $hGraphic, $hPen, $hPen2, $hBitmap, $hBackbuffer, $width = 350, $height = 300, $hCursor, $mouse[4], $xx2, $yy2\n\nGlobal $mapa[10][10]\nGlobal $largura = 800, $altura = 600, $limites[6]\n\nGlobal Const $PI = 3.1415926535897932384626433832795\nGlobal Const $radToDeg = 180 \/ $PI\n\n$hGui = GUICreate('\u00c2ngulos', $largura, $altura)\nGlobal $hSeno = GUICtrlCreateCheckbox('Seno', 10, 5, 80, 20)\nGlobal $hCos = GUICtrlCreateCheckbox('Cosseno', 10, 25, 80, 20)\nGlobal $hTan = GUICtrlCreateCheckbox('Tangente', 100, 5, 80, 20)\nGlobal $hCot = GUICtrlCreateCheckbox('Cotangente', 100, 25, 80, 20)\nGlobal $hSec = GUICtrlCreateCheckbox('Secante', 190, 5, 80, 20)\nGlobal $hPasso = GUICtrlCreateCombo('', 280, 5, 80, 20, $CBS_DROPDOWNLIST)\nGlobal $hInvertido = GUICtrlCreateCheckbox('Inverso', 370, 5, 80, 20)\nGUICtrlSetData($hPasso, 'Livre|1|5|10|15|30', 'Livre')\n\nGlobal $iSeno = 0, $iCos = 0, $iTan = 0, $iCot = 0, $iSec = 0, $iInverso = 0\nGUISetState(@SW_SHOWNORMAL)\n\n_GDIPlus_Startup()\n$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)\n$hBitmap = _GDIPlus_BitmapCreateFromGraphics($largura - 20, $altura - 60, $hGraphic)\n\n_limites()\n\n\nFunc _limites()\n\t$limites[0] = 10\n\t$limites[1] = 50\n\t$limites[2] = $largura - 20\n\t$limites[3] = $altura - 50\n\t$limites[4] = ($largura - 20) \/ 2\n\t$limites[5] = ($altura - 50) \/ 2\n\t;_ArrayDisplay($limites)\nEndFunc ;==>_limites\n$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)\n\n$hPen = _GDIPlus_PenCreate()\n$hPen2 = _GDIPlus_PenCreate(0xFFFF0000)\n$hPen3 = _GDIPlus_PenCreate(0xFF00FF00)\n_GDIPlus_GraphicsClear($hBackbuffer)\n_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)\n\nGlobal $hBrush_01 = _GDIPlus_BrushCreateSolid(0xFF336699)\nGlobal $hBrush_02 = _GDIPlus_BrushCreateSolid(0xFFFF0000)\nGlobal $hBrush_03 = _GDIPlus_BrushCreateSolid(0xFF00FF00)\nGlobal $hFamily = _GDIPlus_FontFamilyCreate('Courier New')\nGlobal $hFont = _GDIPlus_FontCreate($hFamily, 10)\nGlobal $hPosX = _GDIPlus_RectFCreate(2, 0, 120, 15)\nGlobal $hPosY = _GDIPlus_RectFCreate(2, 20, 120, 15)\nGlobal $hAng = _GDIPlus_RectFCreate(2, 80, 120, 15)\nGlobal $hInv = _GDIPlus_RectFCreate(2, 100, 120, 15)\n\nGlobal $hPosX1 = _GDIPlus_RectFCreate(2, 40, 120, 15)\nGlobal $hPosY1 = _GDIPlus_RectFCreate(2, 60, 120, 15)\nGlobal $hStringFormat = _GDIPlus_StringFormatCreate()\n\nGlobal $start = TimerInit()\nWhile 1\n\t$hMsg = GUIGetMsg()\n\tSwitch $hMsg\n\t\tCase $GUI_EVENT_CLOSE\n\t\t\t_exit()\n\t\tCase $hSeno\n\t\t\t$iSeno = _Iif($iSeno == 0, 1, 0)\n\t\tCase $hCos\n\t\t\t$iCos = _Iif($iCos == 0, 1, 0)\n\t\tCase $hTan\n\t\t\t$iTan = _Iif($iTan == 0, 1, 0)\n\t\tCase $hCot\n\t\t\t$iCot = _Iif($iCot == 0, 1, 0)\n\t\tCase $hSec\n\t\t\t$iSec = _Iif($iSec == 0, 1, 0)\n\t\tCase $hInvertido\n\t\t\t$iInverso = _Iif($iInverso == 0, 1, 0)\n\tEndSwitch\n\n\t$hCursor = GUIGetCursorInfo()\n\tIf Not $hCursor Then\n\t\t$mouse[0] = $hCursor[0] - $limites[0]\n\t\t$mouse[1] = $hCursor[1] - $limites[1]\n\tEndIf\n\n\tIf WinActive($hGui) Then\n\t\tIf Not $active Then $active = True\n\t\tIf TimerDiff($start) >= 10 Then\n\t\t\t_update()\n\t\t\t$start = TimerInit()\n\t\tEndIf\n\tElseIf Not WinActive($hGui) And $active Then\n\t\t$active = False\n\tEndIf\nWEnd\n\nFunc _update()\n\t_GDIPlus_GraphicsClear($hBackbuffer, 0xF0FFFFFF)\n\t;_GDIPlus_StringFormatSetAlign($hStringFormat, 1)\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] & ']', $hFont, $hPosX, $hStringFormat, $hBrush_01)\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & $mouse[1] & ']', $hFont, $hPosY, $hStringFormat, $hBrush_01)\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] - 389 & ']', $hFont, $hPosX1, $hStringFormat, $hBrush_02)\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & - ($mouse[1] - 270) & ']', $hFont, $hPosY1, $hStringFormat, $hBrush_02)\n\t$ang = _ang(0, 0, $mouse[0] - 389, -($mouse[1] - 270))\n\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, '\u00ba[' & $ang[0] & ']', $hFont, $hAng, $hStringFormat, $hBrush_02)\n\n\n\t_box($hBackbuffer, 0, 0, $largura - 21, $altura - 61)\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) \/ 2, 0, ($largura - 21) \/ 2, $altura - 60, $hPen)\n\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 0, ($altura - 60) \/ 2, $largura - 21, ($altura - 60) \/ 2, $hPen)\n\t_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) \/ 2 - 200 - 1, ($altura - 60) \/ 2 - 200, 400, 400)\n;~ \t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) \/ 2, ($altura - 60) \/ 2, $mouse[0], $mouse[1], $hPen2)\n\t$cos = Int(200 * Cos(($ang[0] \/ 180) * $PI))\n\t$sen = Int(200 * Sin(($ang[0] \/ 180) * $PI))\n\t$tan = Int(200 * ($sen \/ $cos))\n\t$cot = Int(200 * ($cos \/ $sen))\n\n\t_GDIPlus_GraphicsDrawPie($hBackbuffer, ($largura - 20) \/ 2 - 1 - 25, ($altura - 60) \/ 2 - 25, 50, 50, 0, -$ang[0])\n\n\tIf $iSeno Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389, 270 - $sen, $hPen2)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389, 270 - $sen, $hPen2)\n\tEndIf\n\n\tIf $iCos Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 + $cos, 270, $hPen2)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen2)\n\tEndIf\n\n\tIf $iTan Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 1, 189, 538, $hPen)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 1, 589, 538, $hPen)\n\t\tIf $cos > 0 Then\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 270 - $tan, 589, 270, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 589, 270 - $tan, $hPen2)\n\t\tElse\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 270 + $tan, 189, 270, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 189, 270 + $tan, $hPen2)\n\t\tEndIf\n\tEndIf\n\n\tIf $iCot Then\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 70, 778, 70, $hPen)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 470, 778, 470, $hPen)\n\t\tIf $sen > 0 Then\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, 70, ($largura - 20) \/ 2 - 1 + $cot, 70, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) \/ 2 - 1 + $cot, 70, $hPen2)\n\t\tElse\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, 470, ($largura - 20) \/ 2 - 1 - $cot, 470, $hPen2)\n\t\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) \/ 2 - 1 - $cot, 470, $hPen2)\n\t\tEndIf\n\tEndIf\n\n\tIf $iSec Then\n\t\tLocal $resposta = ''\n\t\tSelect\n\t\t\tCase $ang[0] == 0 Or $ang[0] = 360\n\t\t\t\t$resposta = '#1 secante[n\u00e3o existe]'\n\t\t\tCase $ang[0] > 0 And $ang[0] < 90\n\t\t\t\t$resposta = '#2 secante[' & $ang[0] & '] angulo[' & 90 + $ang[0] & ']'\n\t\t\tCase $ang[0] == 90 Or $ang[0] == 180\n\t\t\t\t$resposta = '#3 secante[n\u00e3o existe]'\n\t\t\tCase $ang[0] > 90 And $ang[0] < 180\n\t\t\t\t$resposta = '#4 secante[' & $ang[0] & '] angulo[' & $ang[0] - 90 & ']'\n\t\t\tCase $ang[0] > 180 And $ang[0] < 270\n\t\t\t\t$resposta = '#5 secante[' & $ang[0] & '] angulo[' & 270 - $ang[0] & ']'\n\t\t\tCase $ang[0] > 270 And $ang[0] < 360\n\t\t\t\t$resposta = '#6 secante[' & $ang[0] & '] angulo[' & $ang[0] - 270 & ']'\n\t\tEndSelect\n\n\t\t$nn1 = 389 + 0 + 1 \/ Int(200 * Cos(($ang[0] \/ 180) * $PI))\n\t\t$nn2 = 270 + 0 - $sen\n\n\t\tConsoleWrite('nn1[' & $nn1 & '] nn2[' & $nn2 & ']' & @LF)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, $nn1, $nn2, $hPen2)\n;~ \t\t_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) \/ 2 - 250 - 1, ($altura - 60) \/ 2 - 250, 500, 500)\n\t\tConsoleWrite($resposta & @LF)\n\tEndIf\n\n\tIf $iInverso Then\n\t\tLocal $invertido = _Iif($ang[0] > 180, $ang[0] - 180, 180 + $ang[0])\n\t\t$invertido = _Iif($invertido = 360, 0, $invertido)\n\t\t$invertido = StringFormat('%.2f', $invertido)\n\t\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 - $cos, 270 + $sen, $hPen3)\n\t\t_GDIPlus_GraphicsDrawStringEx($hBackbuffer, '\u00ba[' & $invertido & ']', $hFont, $hInv, $hStringFormat, $hBrush_03)\n\tEndIf\n\t_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) \/ 2 - 1, ($altura - 60) \/ 2, 389 + $cos, 270 - $sen, $hPen2)\n\n\t_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 10, 50, $largura - 20, $altura - 60)\nEndFunc ;==>_update\n\nFunc _exit()\n\t_GDIPlus_BrushDispose($hBrush_01)\n\t_GDIPlus_BrushDispose($hBrush_02)\n\t_GDIPlus_BrushDispose($hBrush_03)\n\t_GDIPlus_FontFamilyDispose($hFamily)\n\t_GDIPlus_FontDispose($hFont)\n\t_GDIPlus_StringFormatDispose($hStringFormat)\n\n\t_GDIPlus_GraphicsDispose($hBackbuffer)\n\t_GDIPlus_BitmapDispose($hBitmap)\n\t_GDIPlus_PenDispose($hPen)\n\t_GDIPlus_PenDispose($hPen2)\n\t_GDIPlus_PenDispose($hPen3)\n\t_GDIPlus_GraphicsDispose($hGraphic)\n\t_GDIPlus_Shutdown()\n\tExit\nEndFunc ;==>_exit\n\nFunc _box($hToGraphic, $ix1, $iy1, $il, $ia)\n\tLocal $aBox[5][2]\n\t$aBox[0][0] = 4\n\t$aBox[1][0] = $ix1\n\t$aBox[1][1] = $iy1\n\t$aBox[2][0] = $ix1 + $il\n\t$aBox[2][1] = $iy1\n\t$aBox[3][0] = $ix1 + $il\n\t$aBox[3][1] = $iy1 + $ia\n\t$aBox[4][0] = $ix1\n\t$aBox[4][1] = $iy1 + $ia\n\t_GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox)\nEndFunc ;==>_box\n\nFunc _ang($xx1, $yy1, $xx2, $yy2)\n\tLocal $arr[2], $ca = Abs($yy2 - $yy1), $co = Abs($xx2 - $xx1)\n\tSelect\n\t\tCase $xx1 > $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = ATan(($co) \/ ($ca)) * $radToDeg + 90\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 180\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = 270 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\tEndSelect\n\t\tCase $xx1 == $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = 90\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 0\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = 270\n\t\t\tEndSelect\n\t\tCase $xx1 < $xx2\n\t\t\tSelect\n\t\t\t\tCase $yy1 < $yy2\n\t\t\t\t\t$arr[0] = 90 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\t\tCase $yy1 == $yy2\n\t\t\t\t\t$arr[0] = 0\n\t\t\t\tCase $yy1 > $yy2\n\t\t\t\t\t$arr[0] = ATan(($co) \/ ($ca)) * $radToDeg + 270\n\t\t\t\t\t;$arr[0] = 270 - ATan(($co) \/ ($ca)) * $radToDeg\n\t\t\tEndSelect\n\tEndSelect\n\t$arr[0] = StringFormat('%.2f', $arr[0])\n\t$arr[1] = Sqrt($co ^ 2 + $ca ^ 2)\n\tReturn $arr\nEndFunc ;==>_ang\n\nFunc _Iif($aa, $bb, $cc)\n\tIf $aa Then Return $bb\n\tReturn $cc\nEndFunc\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"AutoIt"} {"commit":"3a2839540be9ea33384ab36fb52fe222a99bb5d2","subject":"Added more comments","message":"Added more comments\n\nMore comments to improve debugging abilities\n","repos":"Dannyman3819\/LoudCloud_Notifier","old_file":"LCN_Main.au3","new_file":"LCN_Main.au3","new_contents":"#Region ;**** Directives created by AutoIt3Wrapper_GUI ****\n#AutoIt3Wrapper_Icon=LCN.ico\n#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****\n#cs ----------------------------------------------------------------------------\n\n\tAutoIt Version: 3.3.8.1\n\tLoudCloud Notifier (LCN)\n\tAuthor: Daniel Blevins\n\tContact: DanielBlevinsLCN at Gmail.com\n\tScript Function:\n\tThis script will check your LC notifications and notifiy you if you have any new ones.\n\tspecifically this script runs in the background and runs other scripts\n\n#ce ----------------------------------------------------------------------------\n\n#include \n#include \n#include \n\n#RequireAdmin\nOpt(\"TrayAutoPause\", 0)\nOpt(\"TrayMenuMode\", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode.\nOpt(\"TrayOnEventMode\", 1) ; Enable TrayOnEventMode.\n\nTraySetIcon(\"LCN.ico\")\n$tAbout = TrayCreateItem(\"About\")\nTrayItemSetOnEvent(-1, \"showAbout\")\n$tSetup = TrayCreateItem(\"Setup\")\nTrayItemSetOnEvent(-1, \"tSetup\")\n$tExit = TrayCreateItem(\"Exit\")\nTrayItemSetOnEvent(-1, \"ExitScript\")\nTraySetState(1) ; Show the tray menu.\n\n$sFrequency = \"1\" ;saved Frequency\n$s_f_mOn = \"\" ;main forum\n$s_Ln_aOn = \"1\" ;announcement switch\n$s_f_iOn = \"\" ;individual forum\n$s_w_On = \"\" ;class wall\n$s_a_lOn = \"0\"; turns debugging off until conf file is read\n$s_cOn = \"\" ;computer notification switch\n$adataID = \"\"\n$nCount = 0\n\n$TempDir = @AppDataDir&\"\\LoudCloud_Notifier\\\"\n\n$confHandle = FileOpen($TempDir&\"LCN.conf\") ;load config settings from setup\n$DebugOverride = 0 ;overrides setting in config file good for debugging problems before opening of the conf file\n\n$DebugLog = FileOpen($TempDir&\"debug.log\", 2) ;open log for debugging\n\ndebug(\"Starting Program Advanced script logging\")\nif @error Then errorCode(1001)\n\nIf $confHandle = -1 Then\n\tdebug(\"-Error- No config file found!\")\n\t$setup = MsgBox(4, \"LCN Error\", \"An error has ccured opening config file. Would you like to run setup?\")\n\tIf $setup = \"6\" Then\n\t\tdebug(\"Running LCN Setup\")\n\t\tif FileExists( \"LCN_Gui.au3\" ) Then\n\t\t\tShellExecuteWait(@ProgramFilesDir&\"\/Autoit3\/Autoit3.exe\",\"LCN_Gui.au3\") ;will only execute if source if found\n\t\tElse\n\t\t\tShellExecuteWait(\"LCN_Gui.exe\")\n\t\tEndIf\n\t\t$confHandle = FileOpen(\"LCN.conf\")\n\tElse\n\t\tExit\n\tEndIf\nEndIf\n\n$confRead = FileRead($confHandle)\nIf $confRead = \"\" Then\n\tdebug(\"-Error- Reading config file!\")\n\tMsgBox(1, \"LCN Error\", \"An error has ccured reading config file. Exiting!\")\n\tExit\nEndIf\n\n;class ID's:\n;$PSY = \"9a5769f0-ac0a-4089-9ea7-9a922f94c295\"\n;$ENG = \"a3ba3bfc-8b74-4f86-8ef1-4576345b66ca\"\n;$MAT = \"cb60a800-503d-420e-bee2-b8a65cc9fcf2\"\n;$PHI = \"d16dfd79-74d2-4d46-a186-d38b157f1c8e\"\n\n$sPassword = \"\"\n$sUsername = \"\"\n$AESkey = \"\"\n\n$random = $AESkey\n\nload();loads conf file\ndebug(\"Finished loading config file\")\n\n$delay = @HOUR*60\n$delay = $delay+@MIN ;$delay = timestamp in seconds\n$delay = $delay+$sFrequency\n;$delay = 5 * $sFrequency ;for testing purposes\n$count1 = $delay ;start with counter to max so when program start it will load\n\nWhile 1 ;main background process; error code 02\n\tIf $count1 = $delay Then\n\t\t;MsgBox(0,\"\", $sFrequency)\n\t\t;MsgBox(0, \"\", $delay)\n\t\tload();loads conf file\n\t\tgetRawHtml();runs .bat script to get info from LC\n\t\t$aDataHandleWrite = FileOpen($TempDir&\"dataFile.txt\", 10)\n\t\t$aDataHandle = FileOpen($TempDir&\"dataFile.txt\")\n\t\t$aDataWallHandleWrite = FileOpen($TempDir&\"dataWall.txt\", 10)\n\t\t$aDataWallHandle = FileOpen($TempDir&\"dataWall.txt\")\n\n\n\t\t$dCount = 1\n\t\t$dCount1 = 0 ;clears how many files there are\n\t\tWhile $dCount\n\t\t\t$dCount1 = $dCount1 + 1\n\t\t\tIf FileExists($TempDir&\"Announcements\" & $dCount1 & \".htm\") Then\n\t\t\t\tgetAnnouncements($TempDir&\"Announcements\" & $dCount1 & \".htm\", $TempDir&\"dataFile\" & $dCount1 & \".txt\");parses data into txt file\n\t\t\tElse\n\t\t\t\t$dCount = 0\n\t\t\tEndIf\n\n;~ \t\t\tIf FileExists($TempDir&\"Wall\" & $dCount1 & \".htm\") Then\n;~ \t\t\t\tgetWall($TempDir&\"Wall\" & $dCount1 & \".htm\", $TempDir&\"dataWall\" & $dCount1 & \".txt\");parses data into txt file\n;~ \t\t\tElse\n;~ \t\t\t\t$dCount = 0\n;~ \t\t\tEndIf\n\n\n\t\tWEnd\n\t\tdataCombine($dCount1);function that opens and combines X many data files\n\t\tstart()\n\t\tFileClose($aDataHandleWrite)\n\t\tFileClose($aDataHandle)\n\t\tFileClose($aDataWallHandleWrite)\n\t\tFileClose($aDataWallHandle)\n\t\t$count1 = 0\n\t\t;$delay = 60*60*$sFrequency ;redo incase frequency was changed\n\t\t$delay = @HOUR*60\n\t\t$delay = $delay+@MIN ;$delay = timestamp in seconds\n\t\t$delay = $delay+$sFrequency\n\t\tdebug(\"TimeStamp:\"&$delay)\n\tEndIf\n\n\t$anProcess = ProcessList(\"Notify.exe\")\n\tif $anProcess[0][0] = 0 then\n\t\tTraySetState(8) ;stops flash if no notifications are being displayed\n\tEndIf\n\n\tSleep(100)\n\t;$count1 = $count1 + 1\n\t$count1 = @HOUR*60\n\t$count1 = $count1+@MIN ;$delay = timestamp in minutes ;this counts the current time\n\tif @error Then errorCode(0201)\nWEnd\n\nFunc start() ;error code 04\n\t$aDataHandle = FileOpen($TempDir&\"dataFile.txt\")\n\tif @error Then errorCode(0401)\n\t$aDataBuffer = FileReadLine($aDataHandle, 1); read first line to see if theres an announcements\n\t;if @error Then errorCode(0402) normal error (errors when empty)\n\t$AnnouncementLogHandleRead = FileOpen($TempDir&\"Displayed.log\", 8)\n\tif @error Then errorCode(0403)\n\t$AnnouncementLogHandleWrite = FileOpen($TempDir&\"Displayed.log\", 9)\n\tif @error Then errorCode(0404)\n\tIf $aDataBuffer = \"\" Then ;start while to read data if not empty\n\t\t$loop = 0\n\tElse\n\t\t$loop = 1\n\t\t$count = 1\n\t\t$AnnouncementLog = FileRead($AnnouncementLogHandleRead)\n\t\tif @error Then errorCode(0405)\n\t\tWhile $loop\n\t\t\t$aDataID = FileReadLine($aDataHandle, $count)\n\t\t\t;if @error Then errorCode(0406)\n\t\t\t$count = $count + 1;2\n\t\t\t$aDataAuthor = FileReadLine($aDataHandle, $count)\n\t\t\t;if @error Then errorCode(0407)\n\t\t\t$count = $count + 1;3\n\t\t\t$aDataDate = FileReadLine($aDataHandle, $count)\n\t\t\t;if @error Then errorCode(0408)\n\t\t\t$count = $count + 1;4\n\t\t\t$aDataText = FileReadLine($aDataHandle, $count)\n\t\t\t;if @error Then errorCode(0409)\n\t\t\t$count = $count + 1;5\n\t\t\t$AnnouncementLogCheck = StringInStr($AnnouncementLog, $aDataID)\n\t\t\tIf $aDataID = \"\" Then\n\t\t\t\t$loop = 0\n\t\t\t\t$AnnouncementLogCheck = \"\"\n\t\t\t\t$AnnouncementLog = \"\"\n\t\t\tElse\n\t\t\t\tIf $AnnouncementLogCheck = 0 Then ;check to see if notification has already been displayed for thsi announcement\n\t\t\t\t\tIf FileReadLine($aDataHandle, $count) = \"\" Then ;no more notifications??,,,count reads next data packet (line 5) in file\n\t\t\t\t\t\t;if @error Then errorCode(0410) ;displays error from reading blank line\n\t\t\t\t\t\t$loop = 0\n\t\t\t\t\t\t$AnnouncementLogCheck = \"\"\n\t\t\t\t\t\t$AnnouncementLog = \"\"\n\t\t\t\t\t\t;MsgBox( 1, \"DEBUG 140\", \"HERE\" )\n\t\t\t\t\tEndIf\n\n\t\t\t\t\tFileWriteLine($AnnouncementLogHandleWrite, $aDataID)\n\t\t\t\t\tif @error Then errorCode(0411)\n\t\t\t\t\tNotify(\"Announcement:\" & @CRLF & $aDataAuthor & \" -- \" & $aDataDate, $aDataText)\n\t\t\t\t\t;MsgBox( 1, \"DEBUG 144\", \"HERE\" )\n\t\t\t\tElse\n\t\t\t\t\tdebug(\"Got notification but already displayed: \" & $adataID)\n\t\t\t\tEndIf\n\t\t\tEndIf\n\t\tWEnd\n\tEndIf\n\n\tFileClose($AnnouncementLogHandleRead)\n\tFileClose($AnnouncementLogHandleWrite)\n\nEndFunc ;==>start\n\nFunc dataCombine($fileCount) ;error code 05\n\t$dcCountWhile = 1\n\t$dcCount = 0\n\tWhile $dcCountWhile\n\t\t$dcCount = $dcCount + 1\n\t\tIf $dcCount = $fileCount Then\n\t\t\t$dcCountWhile = 0\n\t\tElse\n\t\t\t$aDataHandle = FileOpen($TempDir&\"dataFile\" & $dcCount & \".txt\")\n\t\t\tif @error Then errorCode(0501)\n\t\t\t$aDataRead = FileRead($aDataHandle)\n\t\t\tif @error Then errorCode(0502)\n\t\t\tFileWrite($aDataHandleWrite, $aDataRead)\n\t\t\tif @error Then errorCode(0503)\n\t\t\tFileClose($aDataHandle)\n\t\tEndIf\n\tWEnd\nEndFunc ;==>dataCombine\n\nFunc Notify($Title, $Text) ;error code 06\n\tif $s_cOn = \"1\" Then ;if computer notifications are on\n\t\tdebug(\"Displaying Notification: \" & $adataID)\n\t\tShellExecute(@ScriptDir & \"\\Notify.exe\", '\"' & $Title & '\"' & \" \" & '\"' & $Text & '\"' & \" \" & '\"-0\"' & \" \" & '\"' & \"GC=7EBEE9 BF=1000 SC=200\" & '\"')\n\t\tTraySetState(4);start flash\n\t\t;syntax(quotes required): Notify.exe \"Title\" \"Message\" \"-0(means permanant until clicked)\" \"GC=(Background Color) BF=(Border Flash)\"\n\t\tif @error Then errorCode(0601)\n\t\tSleep(100) ;required for notify program\n\n\tEndIf\nEndFunc ;==>Notify\n\nFunc getRawHtml() ;error code 03\n\tif $s_f_mOn = \"1\" Then\n\t\t;execute main forum script\n\t\tdebug(\"Getting Main Forum posts from LC\")\n\tEndIf\n\tif $s_Ln_aOn = \"1\" Then\n\t\tdebug(\"Getting Announcements from LC\")\n\t\tCheckInternet()\n\t\tTrayTip( \"LoudCloud Notifier\", \"Getting Announcements...\", 5, 16)\n\t\tShellExecuteWait(@ScriptDir & \"\\Fetch_Announcements.bat\", $sUsername & \" \" & $sPassword, \"\", \"\", @SW_HIDE)\n\t\tIf @error Then errorCode(0301)\n\t\tIf not FileExists($TempDir&\"Announcements1.htm\") Then\n\t\t\tdebug(\"Either incorrect user or pass, or no class ID's\")\n\t\t\t$setup = MsgBox( 4, \"LCN\", \"-Error- Either incorrect username or password, or you did not get class ID's\" &@CRLF& \"You must run setup again for program to work! Run?\")\n\t\t\tIf $setup = \"6\" Then\n\t\t\t\tdebug(\"Running LCN Setup\")\n\t\t\t\tif FileExists( \"LCN_Gui.exe\" ) Then\n\t\t\t\t\tRunWait(\"LCN_Gui.exe\")\n\t\t\t\tElse\n\t\t\t\t\tRunWait(\"LCN_Gui.au3\")\n\t\t\t\tEndIf\n\t\t\t\tgetRawHtml() ;run this function again\n\t\t\tElse\n\t\t\t\tdebug(\"Exiting!\")\n\t\t\t\tExit\n\t\t\tEndIf\n\t\tEndIf\n\tEndIf\n\tif $s_f_iOn = \"1\" Then\n\t\t;execute idividual forum script\n\t\tdebug(\"Getting Individual Forum posts from LC\")\n\tEndIf\n;~ \tif $s_w_On = \"1\" Then\n;~ \t\tdebug(\"Getting Class Wall posts from LC\")\n;~ \t\tCheckInternet()\n;~ \t\tTrayTip( \"LoudCloud Notifier\", \"Getting Class Wall Posts...\", 5, 16)\n;~ \t\tShellExecuteWait(@ScriptDir & \"\\Fetch_Wall.bat\", $sUsername & \" \" & $sPassword, \"\", \"\", @SW_HIDE)\n;~ \t\tIf @error Then errorCode(0301)\n;~ \t\tIf not FileExists($TempDir&\"Announcements1.htm\") Then\n;~ \t\t\tdebug(\"Either incorrect user or pass, or no class ID's\")\n;~ \t\t\t$setup = MsgBox( 4, \"LCN\", \"-Error- Either incorrect username or password, or you did not get class ID's\" &@CRLF& \"You must run setup again for program to work! Run?\")\n;~ \t\t\tIf $setup = \"6\" Then\n;~ \t\t\t\tdebug(\"Running LCN Setup\")\n;~ \t\t\t\tif FileExists( \"LCN_Gui.exe\" ) Then\n;~ \t\t\t\t\tRunWait(\"LCN_Gui.exe\")\n;~ \t\t\t\tElse\n;~ \t\t\t\t\tRunWait(\"LCN_Gui.au3\")\n;~ \t\t\t\tEndIf\n;~ \t\t\t\tgetRawHtml() ;run this function again\n;~ \t\t\tElse\n;~ \t\t\t\tdebug(\"Exiting!\")\n;~ \t\t\t\tExit\n;~ \t\t\tEndIf\n;~ \t\tEndIf\n\n;~ \tEndIf\nEndFunc ;==>getRawHtml\n\nFunc getAnnouncements($htmFile, $dataFile) ;error code 07\n\t$Announcements = FileOpen($htmFile) ;open announcements file\n\tif @error Then errorCode(0701)\n\t$txtOpenAnnouncements = FileOpen($dataFile, 10) ;open file for finished processing\n\tif @error Then errorCode(0702)\n\t$R_Announcements = FileRead($Announcements)\n\tif @error Then errorCode(0703)\n\n\t$aBlocks = _StringBetween2($R_Announcements, \"\") ;find table of info\n\t;MsgBox(1, \"Debug2\", $aBlocks)\n\t;FileWrite($tOpenAnnouncements,$aBlocks) ;write data into processing file\n\t$a1 = StringInStr($aBlocks, \"<\/tr>\") ;find where actual info starts\n\t$aBlocksSplit = StringTrimLeft($aBlocks, $a1) ;trim unneeded header\n\n\t$a1 = StringInStr($aBlocks, \"', \"<\/a>\") ;saves text\n\n\t\t$aAuthor = _StringBetween2($aBlocksSplit, \"\", \"<\/td>\") ;saves Author\n\t\t$a2 = StringInStr($aBlocksSplit, \"\") ;finds authors postion\n\t\t$aBlocksSplit = StringTrimLeft($aBlocksSplit, $a2) ;deletes author data\n\t\t$aDate = _StringBetween2($aBlocksSplit, \"\", \"<\/td>\") ;saves date\n\t\t$a2 = StringInStr($aBlocksSplit, \"<\/tr>\") ;find irrelevant data that will get in the way\n\t\t$aBlocksSplit = StringTrimLeft($aBlocksSplit, $a2) ;deletes data\n\n\t\tIf StringInStr($aBlocksSplit, \"getAnnouncements\n\nFunc getWall($htmFile, $dataFile)\n\n\n\nEndFunc\n\nFunc _StringBetween2($s, $from, $to)\n\t$x = StringInStr($s, $from) + StringLen($from)\n\t$y = StringInStr(StringTrimLeft($s, $x), $to)\n\tReturn StringMid($s, $x, $y)\nEndFunc ;==>_StringBetween2\n\nFunc load() ;Error code number 01\n\t$confHandle = FileOpen($TempDir&\"LCN.conf\")\n\tdebug(\"Loading config file\")\n\tLocal $readBuffer = \"\"\n\t;$random = FileReadLine($confHandle, 8) ;random\n\t;if @error Then errorCode(0101)\n\n\t_Crypt_Startup()\n\t$readBuffer = FileReadLine($confHandle, 2) ;username\n\tif @error Then errorCode(0102)\n\t$sUsername = BinaryToString(_Crypt_DecryptData($readBuffer,$random, $CALG_AES_256))\n\tif @error Then errorCode(0104)\n\n\t$readBuffer = FileReadLine($confHandle, 3) ;pass\n\t;if @error Then errorCode(0105)\n\t$sPassword = BinaryToString(_Crypt_DecryptData($readBuffer,$random, $CALG_AES_256))\n\tif @error Then errorCode(0107)\n\t_Crypt_Shutdown()\n\n\t$sFrequency = FileReadLine($confHandle, 4) ;Frequency\n\tif @error Then errorCode(0108)\n\t$s_cOn = FileReadLine($confHandle, 5) ;computer contifications\n\tif @error Then errorCode(0109)\n\t$s_f_mOn = FileReadLine($confHandle, 6) ;notifiy for main forum\n\tif @error Then errorCode(0110)\n\t$s_Ln_aOn = FileReadLine($confHandle, 7) ;notify for announcements\n\tif @error Then errorCode(0111)\n\t$s_f_iOn = FileReadLine($confHandle, 9) ;notify for individual forum\n\tif @error Then errorCode(0112)\n\t$s_w_On = FileReadLine($confHandle, 10) ;class wall\n\tif @error Then errorCode(0113)\n\t$s_a_lOn = FileReadLine($confHandle, 11) ;debug logging\n\tif @error Then errorCode(0114)\n\tFileClose($confHandle)\n\n\t;debug($sUsername & $sPassword & $sFrequency & $s_cOn & $s_f_mOn & $s_Ln_aOn & $s_f_iOn & $s_w_On & $s_a_lOn)\n\nEndFunc ;==>load\n\nFunc getClassID() ;error code 08\n\tdebug(\"Getting Class ID's\")\n\tShellExecuteWait(@ScriptDir & \"\\Fetch_ClassID.bat\", $sUsername & \" \" & $sPassword, \"\", \"\", @SW_HIDE)\n\tif @error Then errorCode(0801)\n\t$cID_MainReadHandle = FileOpen($TempDir&\"Main_Page.htm\")\n\t$cID_ClassesIDWriteHandle = FileOpen($TempDir&\"ClassesID.txt\", 2) ;write mode, overwrites data\n\t$cID_ClassesNameWriteHandle = FileOpen($TempDir&\"ClassesName.txt\", 2) ;write mode, overwrites data\n\tif @error Then errorCode(0802)\n\n\t$cID_MainRead = FileRead($cID_MainReadHandle)\n\tif @error Then errorCode(0803)\n\n\t$cID_WhileCount = 1\n\tWhile $cID_WhileCount\n\n\t\t$cID_IDBlock = _StringBetween2($cID_MainRead, 'input class=\"allClassCheck\" checked=\"checked\" type=\"checkbox\" name=\"allClassCheck\" value=\"', '\" \/><\/span>') ;find table of info\n\n\t\t;MsgBox(1, \"DEBUG 14\", $cID_IDBlock)\n\n\t\tFileWriteLine($cID_ClassesIDWriteHandle, $cID_IDBlock) ;write data into processing file\n\t\t$cID_IDBlockNumber = StringInStr($cID_MainRead, 'input class=\"allClassCheck\" checked=\"checked\" type=\"checkbox\" name=\"allClassCheck\" value=\"') ;find where actual info starts\n\t\t$cID_IDBlockNumber = $cID_IDBlockNumber - 1 ;removes data 1 line before the ID\n\t\tif @error Then errorCode(0804)\n\t\t;MsgBox(1, \"DEBUG 20\", $cID_IDBlockNumber)\n\n\t\t$cID_MainRead = StringTrimLeft($cID_MainRead, $cID_IDBlockNumber) ;trim used data that will get in the way\n\n\t\t$cID_NameBlock = _StringBetween2($cID_MainRead, '\" \/><\/span>