Advertisement
Guest User

Untitled

a guest
Apr 12th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 193.68 KB | None | 0 0
  1. ; <AUT2EXE VERSION: 3.2.3.0>
  2.  
  3. ; ----------------------------------------------------------------------------
  4. ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\All Users\Documents\Tantra\agit.au3>
  5. ; ----------------------------------------------------------------------------
  6.  
  7.  
  8. ; ----------------------------------------------------------------------------
  9. ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\All Users\Documents\Tantra\mem.au3>
  10. ; ----------------------------------------------------------------------------
  11.  
  12. Func _MemRead($i_hProcess, $i_lpBaseAddress, $i_nSize, $v_lpNumberOfBytesRead = '')
  13.     Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']')
  14.     DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead)
  15.     Local $v_Return = DllStructGetData ($v_Struct, 1)
  16.     $v_Struct=0
  17.     Return $v_Return
  18. EndFunc ;==> _MemRead()
  19.  
  20. Func _MemWrite($i_hProcess, $i_lpBaseAddress, $v_Inject, $i_nSize, $v_lpNumberOfBytesRead = '')
  21.     Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']')
  22.     DllStructSetData ($v_Struct, 1, $v_Inject)
  23.     $i_Call = DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead)
  24.     $v_Struct=0
  25.     Return $i_Call[0]
  26. EndFunc ;==> _MemWrite()
  27.  
  28. Func _MemOpen($i_dwDesiredAccess, $i_bInheritHandle, $i_dwProcessId)
  29.     $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $i_dwDesiredAccess, 'int', $i_bInheritHandle, 'int', $i_dwProcessId)
  30.     If @error Then
  31.         SetError(1)
  32.         Return 0
  33.     EndIf
  34.     Return $ai_Handle[0]
  35. EndFunc ;==> _MemOpen()
  36.  
  37. Func _MemClose($i_hProcess)
  38.     $av_CloseHandle = DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $i_hProcess)
  39.     Return $av_CloseHandle[0]
  40. EndFunc ;==> _MemClose()
  41.  
  42.  
  43. ; ----------------------------------------------------------------------------
  44. ; <AUT2EXE INCLUDE-END: C:\Documents and Settings\All Users\Documents\Tantra\mem.au3>
  45. ; ----------------------------------------------------------------------------
  46.  
  47.  
  48. ; ----------------------------------------------------------------------------
  49. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\GUIConstants.au3>
  50. ; ----------------------------------------------------------------------------
  51.  
  52.  
  53. ; ------------------------------------------------------------------------------
  54. ;
  55. ; AutoIt Version: 3.2
  56. ; Description:    Stub file providing compatibility between the new
  57. ;                       library design and the old.
  58. ;
  59. ; ------------------------------------------------------------------------------
  60.  
  61.  
  62. ; ----------------------------------------------------------------------------
  63. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\GUIDefaultConstants.au3>
  64. ; ----------------------------------------------------------------------------
  65.  
  66.  
  67. ; ------------------------------------------------------------------------------
  68. ;
  69. ; AutoIt Version: 3.2
  70. ; Language:       English
  71. ; Description:    AutoIt-GUI default control styles.
  72. ;
  73. ; ------------------------------------------------------------------------------
  74.  
  75.  
  76. ; ----------------------------------------------------------------------------
  77. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\WindowsConstants.au3>
  78. ; ----------------------------------------------------------------------------
  79.  
  80.  
  81. ; ------------------------------------------------------------------------------
  82. ;
  83. ; AutoIt Version: 3.2
  84. ; Description:    Windows constants.
  85. ;
  86. ; ------------------------------------------------------------------------------
  87.  
  88. ; Window Styles
  89. Global Const $WS_TILED              = 0
  90. Global Const $WS_OVERLAPPED         = 0
  91. Global Const $WS_MAXIMIZEBOX        = 0x00010000
  92. Global Const $WS_MINIMIZEBOX        = 0x00020000
  93. Global Const $WS_TABSTOP            = 0x00010000
  94. Global Const $WS_GROUP              = 0x00020000
  95. Global Const $WS_SIZEBOX            = 0x00040000
  96. Global Const $WS_THICKFRAME         = 0x00040000
  97. Global Const $WS_SYSMENU            = 0x00080000
  98. Global Const $WS_HSCROLL            = 0x00100000
  99. Global Const $WS_VSCROLL            = 0x00200000
  100. Global Const $WS_DLGFRAME           = 0x00400000
  101. Global Const $WS_BORDER             = 0x00800000
  102. Global Const $WS_CAPTION            = 0x00C00000
  103. Global Const $WS_OVERLAPPEDWINDOW   = 0x00CF0000
  104. Global Const $WS_TILEDWINDOW        = 0x00CF0000
  105. Global Const $WS_MAXIMIZE           = 0x01000000
  106. Global Const $WS_CLIPCHILDREN       = 0x02000000
  107. Global Const $WS_CLIPSIBLINGS       = 0x04000000
  108. Global Const $WS_DISABLED           = 0x08000000
  109. Global Const $WS_VISIBLE            = 0x10000000
  110. Global Const $WS_MINIMIZE           = 0x20000000
  111. Global Const $WS_CHILD              = 0x40000000
  112. Global Const $WS_POPUP              = 0x80000000
  113. Global Const $WS_POPUPWINDOW        = 0x80880000
  114.  
  115. ; Dialog Styles
  116. Global Const $DS_MODALFRAME         = 0x80
  117. Global Const $DS_SETFOREGROUND      = 0x00000200
  118. Global Const $DS_CONTEXTHELP        = 0x00002000
  119.  
  120. ; Window Extended Styles
  121. Global Const $WS_EX_ACCEPTFILES         = 0x00000010
  122. Global Const $WS_EX_MDICHILD            = 0x00000040
  123. Global Const $WS_EX_APPWINDOW           = 0x00040000
  124. Global Const $WS_EX_CLIENTEDGE          = 0x00000200
  125. Global Const $WS_EX_CONTEXTHELP         = 0x00000400
  126. Global Const $WS_EX_DLGMODALFRAME       = 0x00000001
  127. Global Const $WS_EX_LEFTSCROLLBAR       = 0x00004000
  128. Global Const $WS_EX_OVERLAPPEDWINDOW    = 0x00000300
  129. Global Const $WS_EX_RIGHT               = 0x00001000
  130. Global Const $WS_EX_STATICEDGE          = 0x00020000
  131. Global Const $WS_EX_TOOLWINDOW          = 0x00000080
  132. Global Const $WS_EX_TOPMOST             = 0x00000008
  133. Global Const $WS_EX_TRANSPARENT         = 0x00000020
  134. Global Const $WS_EX_WINDOWEDGE          = 0x00000100
  135. Global Const $WS_EX_LAYERED             = 0x00080000
  136.  
  137. ; Messages
  138. Global Const $WM_SIZE = 0x05
  139. Global Const $WM_SIZING = 0x0214
  140. Global Const $WM_USER = 0X400
  141. Global Const $WM_GETTEXTLENGTH = 0x000E
  142. Global Const $WM_GETTEXT = 0x000D
  143.  
  144. ; ----------------------------------------------------------------------------
  145. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\WindowsConstants.au3>
  146. ; ----------------------------------------------------------------------------
  147.  
  148.  
  149. ; ----------------------------------------------------------------------------
  150. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\AVIConstants.au3>
  151. ; ----------------------------------------------------------------------------
  152.  
  153.  
  154. ; ------------------------------------------------------------------------------
  155. ;
  156. ; AutoIt Version: 3.2
  157. ; Description:    AVI Constants.
  158. ;
  159. ; ------------------------------------------------------------------------------
  160.  
  161. ; Styles
  162. Global Const $ACS_CENTER            = 1
  163. Global Const $ACS_TRANSPARENT       = 2
  164. Global Const $ACS_AUTOPLAY          = 4
  165. Global Const $ACS_TIMER             = 8
  166. Global Const $ACS_NONTRANSPARENT    = 16
  167.  
  168. ; ----------------------------------------------------------------------------
  169. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\AVIConstants.au3>
  170. ; ----------------------------------------------------------------------------
  171.  
  172.  
  173. ; ----------------------------------------------------------------------------
  174. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ComboConstants.au3>
  175. ; ----------------------------------------------------------------------------
  176.  
  177.  
  178. ; ------------------------------------------------------------------------------
  179. ;
  180. ; AutoIt Version: 3.2
  181. ; Description:    ComboBox constants.
  182. ;
  183. ; ------------------------------------------------------------------------------
  184. ; Combo
  185. Global Const $CBS_SIMPLE            = 0x0001
  186. Global Const $CBS_DROPDOWN          = 0x0002
  187. Global Const $CBS_DROPDOWNLIST      = 0x0003
  188. Global Const $CBS_AUTOHSCROLL       = 0x0040
  189. Global Const $CBS_OEMCONVERT        = 0x0080
  190. Global Const $CBS_SORT              = 0x0100
  191. Global Const $CBS_NOINTEGRALHEIGHT  = 0x0400
  192. Global Const $CBS_DISABLENOSCROLL   = 0x0800
  193. Global Const $CBS_UPPERCASE         = 0x2000
  194. Global Const $CBS_LOWERCASE         = 0x4000
  195.  
  196. ; Error checking
  197. Global Const $CB_ERR = -1
  198. Global Const $CB_ERRATTRIBUTE = -3
  199. Global Const $CB_ERRREQUIRED = -4
  200. Global Const $CB_ERRSPACE = -2
  201. Global Const $CB_OKAY = 0
  202.  
  203. ; Messages to send to combobox
  204. Global Const $CB_ADDSTRING = 0x143
  205. Global Const $CB_DELETESTRING = 0x144
  206. Global Const $CB_DIR = 0x145
  207. Global Const $CB_FINDSTRING = 0x14C
  208. Global Const $CB_FINDSTRINGEXACT = 0x158
  209. Global Const $CB_GETCOUNT = 0x146
  210. Global Const $CB_GETCURSEL = 0x147
  211. Global Const $CB_GETDROPPEDCONTROLRECT = 0x152
  212. Global Const $CB_GETDROPPEDSTATE = 0x157
  213. Global Const $CB_GETDROPPEDWIDTH = 0X15f
  214. Global Const $CB_GETEDITSEL = 0x140
  215. Global Const $CB_GETEXTENDEDUI = 0x156
  216. Global Const $CB_GETHORIZONTALEXTENT = 0x15d
  217. Global Const $CB_GETITEMDATA = 0x150
  218. Global Const $CB_GETITEMHEIGHT = 0x154
  219. Global Const $CB_GETLBTEXT = 0x148
  220. Global Const $CB_GETLBTEXTLEN = 0x149
  221. Global Const $CB_GETLOCALE = 0x15A
  222. Global Const $CB_GETMINVISIBLE = 0x1702
  223. Global Const $CB_GETTOPINDEX = 0x15b
  224. Global Const $CB_INITSTORAGE = 0x161
  225. Global Const $CB_LIMITTEXT = 0x141
  226. Global Const $CB_RESETCONTENT = 0x14B
  227. Global Const $CB_INSERTSTRING = 0x14A
  228. Global Const $CB_SELECTSTRING = 0x14D
  229. Global Const $CB_SETCURSEL = 0x14E
  230. Global Const $CB_SETDROPPEDWIDTH = 0x160
  231. Global Const $CB_SETEDITSEL = 0x142
  232. Global Const $CB_SETEXTENDEDUI = 0x155
  233. Global Const $CB_SETHORIZONTALEXTENT = 0x15e
  234. Global Const $CB_SETITEMDATA = 0x151
  235. Global Const $CB_SETITEMHEIGHT = 0x153
  236. Global Const $CB_SETLOCALE = 0x15
  237. Global Const $CB_SETMINVISIBLE = 0x1701
  238. Global Const $CB_SETTOPINDEX = 0x15c
  239. Global Const $CB_SHOWDROPDOWN = 0x14F
  240.  
  241. ; attributes
  242. Global Const $CB_DDL_ARCHIVE = 0x20
  243. Global Const $CB_DDL_DIRECTORY = 0x10
  244. Global Const $CB_DDL_DRIVES = 0x4000
  245. Global Const $CB_DDL_EXCLUSIVE = 0x8000
  246. Global Const $CB_DDL_HIDDEN = 0x2
  247. Global Const $CB_DDL_READONLY = 0x1
  248. Global Const $CB_DDL_READWRITE = 0x0
  249. Global Const $CB_DDL_SYSTEM = 0x4
  250.  
  251. ; ----------------------------------------------------------------------------
  252. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ComboConstants.au3>
  253. ; ----------------------------------------------------------------------------
  254.  
  255.  
  256. ; ----------------------------------------------------------------------------
  257. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\DateTimeConstants.au3>
  258. ; ----------------------------------------------------------------------------
  259.  
  260.  
  261. ; ------------------------------------------------------------------------------
  262. ;
  263. ; AutoIt Version: 3.1.1 (beta)
  264. ; Language:       English
  265. ; Description:    DateTime Control Constants.
  266. ;
  267. ; ------------------------------------------------------------------------------
  268.  
  269. ; Date
  270. Global Const $DTS_SHORTDATEFORMAT   = 0
  271. Global Const $DTS_UPDOWN            = 1
  272. Global Const $DTS_SHOWNONE          = 2
  273. Global Const $DTS_LONGDATEFORMAT    = 4
  274. Global Const $DTS_TIMEFORMAT        = 9
  275. Global Const $DTS_RIGHTALIGN        = 32
  276.  
  277. ; MonthCal
  278. Global Const $MCS_NOTODAY           = 16
  279. Global Const $MCS_NOTODAYCIRCLE     = 8
  280. Global Const $MCS_WEEKNUMBERS       = 4
  281.  
  282. Global Const $MCM_FIRST = 0x1000
  283. Global Const $MCM_GETCOLOR = ($MCM_FIRST + 11)
  284. Global Const $MCM_GETFIRSTDAYOFWEEK = ($MCM_FIRST + 16)
  285. Global Const $MCM_GETMAXSELCOUNT = ($MCM_FIRST + 3)
  286. Global Const $MCM_GETMAXTODAYWIDTH = ($MCM_FIRST + 21)
  287. Global Const $MCM_GETMINREQRECT = ($MCM_FIRST + 9)
  288. Global Const $MCM_GETMONTHDELTA = ($MCM_FIRST + 19)
  289. Global Const $MCS_MULTISELECT = 0x2
  290. Global Const $MCM_SETCOLOR = ($MCM_FIRST + 10)
  291. Global Const $MCM_SETFIRSTDAYOFWEEK = ($MCM_FIRST + 15)
  292. Global Const $MCM_SETMAXSELCOUNT = ($MCM_FIRST + 4)
  293. Global Const $MCM_SETMONTHDELTA = ($MCM_FIRST + 20)
  294.  
  295. Global Const $MCSC_BACKGROUND = 0
  296. Global Const $MCSC_MONTHBK = 4
  297. Global Const $MCSC_TEXT = 1
  298. Global Const $MCSC_TITLEBK = 2
  299. Global Const $MCSC_TITLETEXT = 3
  300. Global Const $MCSC_TRAILINGTEXT = 5
  301.  
  302. ; ----------------------------------------------------------------------------
  303. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\DateTimeConstants.au3>
  304. ; ----------------------------------------------------------------------------
  305.  
  306.  
  307. ; ----------------------------------------------------------------------------
  308. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\EditConstants.au3>
  309. ; ----------------------------------------------------------------------------
  310.  
  311.  
  312. ; ------------------------------------------------------------------------------
  313. ;
  314. ; AutoIt Version: 3.2
  315. ; Language:       English
  316. ; Description:    Edit Constants.
  317. ;
  318. ; ------------------------------------------------------------------------------
  319.  
  320. ; Styles
  321. Global Const $ES_LEFT               = 0
  322. Global Const $ES_CENTER             = 1
  323. Global Const $ES_RIGHT              = 2
  324. Global Const $ES_MULTILINE          = 4
  325. Global Const $ES_UPPERCASE          = 8
  326. Global Const $ES_LOWERCASE          = 16
  327. Global Const $ES_PASSWORD           = 32
  328. Global Const $ES_AUTOVSCROLL        = 64
  329. Global Const $ES_AUTOHSCROLL        = 128
  330. Global Const $ES_NOHIDESEL          = 256
  331. Global Const $ES_OEMCONVERT         = 1024
  332. Global Const $ES_READONLY           = 2048
  333. Global Const $ES_WANTRETURN         = 4096
  334. Global Const $ES_NUMBER             = 8192
  335. ;Global Const $ES_DISABLENOSCROLL = 8192
  336. ;Global Const $ES_SUNKEN = 16384
  337. ;Global Const $ES_VERTICAL = 4194304
  338. ;Global Const $ES_SELECTIONBAR = 16777216
  339.  
  340. ; Error checking
  341. Global Const $EC_ERR = -1
  342.  
  343. ; Messages to send to edit control
  344. Global Const $ECM_FIRST = 0X1500
  345. Global Const $EM_CANUNDO = 0xC6
  346. Global Const $EM_EMPTYUNDOBUFFER = 0xCD
  347. Global Const $EM_GETFIRSTVISIBLELINE = 0xCE
  348. Global Const $EM_GETLINE = 0xC4
  349. Global Const $EM_GETLINECOUNT = 0xBA
  350. Global Const $EM_GETMODIFY = 0xB8
  351. Global Const $EM_GETRECT = 0xB2
  352. Global Const $EM_GETSEL = 0xB0
  353. Global Const $EM_LINEFROMCHAR = 0xC9
  354. Global Const $EM_LINEINDEX = 0xBB
  355. Global Const $EM_LINELENGTH = 0xC1
  356. Global Const $EM_LINESCROLL = 0xB6
  357. Global Const $EM_REPLACESEL = 0xC2
  358. Global Const $EM_SCROLL = 0xB5
  359. Global Const $EM_SCROLLCARET = 0x00B7
  360. Global Const $EM_SETMODIFY = 0xB9
  361. Global Const $EM_SETSEL = 0xB1
  362. Global Const $EM_UNDO = 0xC7
  363. Global Const $EM_SETREADONLY = 0x00CF
  364. Global Const $EM_SETTABSTOPS = 0x00CB
  365.  
  366. ; ----------------------------------------------------------------------------
  367. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\EditConstants.au3>
  368. ; ----------------------------------------------------------------------------
  369.  
  370.  
  371. ; ----------------------------------------------------------------------------
  372. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\StaticConstants.au3>
  373. ; ----------------------------------------------------------------------------
  374.  
  375.  
  376. ; ------------------------------------------------------------------------------
  377. ;
  378. ; AutoIt Version: 3.2
  379. ; Description:    Static (label, pic, icon) Constants.
  380. ;
  381. ; ------------------------------------------------------------------------------
  382.  
  383. ; Label/Pic/Icon
  384. Global Const $SS_LEFT           = 0
  385. Global Const $SS_CENTER         = 1
  386. Global Const $SS_RIGHT          = 2
  387. Global Const $SS_ICON           = 3
  388. Global Const $SS_BLACKRECT      = 4
  389. Global Const $SS_GRAYRECT       = 5
  390. Global Const $SS_WHITERECT      = 6
  391. Global Const $SS_BLACKFRAME     = 7
  392. Global Const $SS_GRAYFRAME      = 8
  393. Global Const $SS_WHITEFRAME     = 9
  394. Global Const $SS_SIMPLE         = 11
  395. Global Const $SS_LEFTNOWORDWRAP = 12
  396. Global Const $SS_BITMAP         = 15
  397. Global Const $SS_ETCHEDHORZ     = 16
  398. Global Const $SS_ETCHEDVERT     = 17
  399. Global Const $SS_ETCHEDFRAME    = 18
  400. Global Const $SS_NOPREFIX       = 0x0080
  401. Global Const $SS_NOTIFY         = 0x0100
  402. Global Const $SS_CENTERIMAGE    = 0x0200
  403. Global Const $SS_RIGHTJUST      = 0x0400
  404. Global Const $SS_SUNKEN         = 0x1000
  405.  
  406. ; ----------------------------------------------------------------------------
  407. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\StaticConstants.au3>
  408. ; ----------------------------------------------------------------------------
  409.  
  410.  
  411. ; ----------------------------------------------------------------------------
  412. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ListBoxConstants.au3>
  413. ; ----------------------------------------------------------------------------
  414.  
  415.  
  416. ; ------------------------------------------------------------------------------
  417. ;
  418. ; AutoIt Version: 3.2
  419. ; Description:    ListBox Constants.
  420. ;
  421. ; ------------------------------------------------------------------------------
  422.  
  423. ; Styles
  424. Global Const $LBS_NOTIFY            = 0x0001
  425. Global Const $LBS_SORT              = 0x0002
  426. Global Const $LBS_USETABSTOPS       = 0x0080
  427. Global Const $LBS_NOINTEGRALHEIGHT  = 0x0100
  428. Global Const $LBS_DISABLENOSCROLL   = 0x1000
  429. Global Const $LBS_NOSEL             = 0x4000
  430. Global Const $LBS_STANDARD          = 0xA00003
  431.  
  432. ; Errors
  433. Global Const $LB_ERR = -1
  434. Global Const $LB_ERRATTRIBUTE = -3
  435. Global Const $LB_ERRREQUIRED = -4
  436. Global Const $LB_ERRSPACE = -2
  437.  
  438. ; Messages to send to listbox
  439. Global Const $LB_ADDSTRING = 0x180
  440. Global Const $LB_DELETESTRING = 0x182
  441. Global Const $LB_DIR = 0x18D
  442. Global Const $LB_FINDSTRING = 0x18F
  443. Global Const $LB_FINDSTRINGEXACT = 0x1A2
  444. Global Const $LB_GETANCHORINDEX = 0x019D
  445. Global Const $LB_GETCARETINDEX = 0x019F
  446. Global Const $LB_GETCOUNT = 0x18B
  447. Global Const $LB_GETCURSEL = 0x188
  448. Global Const $LB_GETHORIZONTALEXTENT = 0x193
  449. Global Const $LB_GETITEMRECT = 0x198
  450. Global Const $LB_GETLISTBOXINFO = 0x01B2
  451. Global Const $LB_GETLOCALE = 0x1A6
  452. Global Const $LB_GETSEL = 0x0187
  453. Global Const $LB_GETSELCOUNT = 0x0190
  454. Global Const $LB_GETSELITEMS = 0X191
  455. Global Const $LB_GETTEXT = 0x0189
  456. Global Const $LB_GETTEXTLEN = 0x018A
  457. Global Const $LB_GETTOPINDEX = 0x018E
  458. Global Const $LB_INSERTSTRING = 0x181
  459. Global Const $LB_RESETCONTENT = 0x184
  460. Global Const $LB_SELECTSTRING = 0x18C
  461. Global Const $LB_SETITEMHEIGHT = 0x1A0
  462. Global Const $LB_SELITEMRANGE = 0x19B
  463. Global Const $LB_SELITEMRANGEEX = 0x0183
  464. Global Const $LB_SETANCHORINDEX = 0x19C
  465. Global Const $LB_SETCARETINDEX = 0x19E
  466. Global Const $LB_SETCURSEL = 0x186
  467. Global Const $LB_SETHORIZONTALEXTENT = 0x194
  468. Global Const $LB_SETLOCALE = 0x1A5
  469. Global Const $LB_SETSEL = 0x0185
  470. Global Const $LB_SETTOPINDEX = 0x197
  471.  
  472. Global Const $LBS_MULTIPLESEL = 0x8
  473.  
  474. ; attributes
  475. Global Const $DDL_ARCHIVE = 0x20
  476. Global Const $DDL_DIRECTORY = 0x10
  477. Global Const $DDL_DRIVES = 0x4000
  478. Global Const $DDL_EXCLUSIVE = 0x8000
  479. Global Const $DDL_HIDDEN = 0x2
  480. Global Const $DDL_READONLY = 0x1
  481. Global Const $DDL_READWRITE = 0x0
  482. Global Const $DDL_SYSTEM = 0x4
  483.  
  484. ; ----------------------------------------------------------------------------
  485. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ListBoxConstants.au3>
  486. ; ----------------------------------------------------------------------------
  487.  
  488.  
  489. ; ----------------------------------------------------------------------------
  490. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ListViewConstants.au3>
  491. ; ----------------------------------------------------------------------------
  492.  
  493.  
  494. ; ------------------------------------------------------------------------------
  495. ;
  496. ; AutoIt Version: 3.2
  497. ; Description:    ListView Constants.
  498. ;
  499. ; ------------------------------------------------------------------------------
  500.  
  501. ; Styles
  502. Global Const $LVS_ICON              = 0x0000
  503. Global Const $LVS_REPORT            = 0x0001
  504. Global Const $LVS_SMALLICON         = 0x0002
  505. Global Const $LVS_LIST              = 0x0003
  506. Global Const $LVS_EDITLABELS        = 0x0200
  507. Global Const $LVS_NOCOLUMNHEADER    = 0x4000
  508. Global Const $LVS_NOSORTHEADER      = 0x8000
  509. Global Const $LVS_SINGLESEL         = 0x0004
  510. Global Const $LVS_SHOWSELALWAYS     = 0x0008
  511. Global Const $LVS_SORTASCENDING     = 0X0010
  512. Global Const $LVS_SORTDESCENDING    = 0x0020
  513. Global Const $LVS_NOLABELWRAP       = 0x0080
  514.  
  515. ; listView Extended Styles
  516. Global Const $LVS_EX_FULLROWSELECT      = 0x00000020
  517. Global Const $LVS_EX_GRIDLINES          = 0x00000001
  518. Global Const $LVS_EX_SUBITEMIMAGES      = 0x00000002
  519. Global Const $LVS_EX_CHECKBOXES         = 0x00000004
  520. Global Const $LVS_EX_TRACKSELECT        = 0x00000008
  521. Global Const $LVS_EX_HEADERDRAGDROP     = 0x00000010
  522. Global Const $LVS_EX_FLATSB             = 0x00000100
  523. Global Const $LVS_EX_BORDERSELECT       = 0x00008000
  524. ;Global Const $LVS_EX_MULTIWORKAREAS        = 0x00002000
  525. ;Global Const $LVS_EX_SNAPTOGRID            = 0x00080000
  526. ;Global Const $LVS_EX_DOUBLEBUFFER      = 0x00010000
  527. Global Const $LVS_EX_HIDELABELS = 0x20000
  528. Global Const $LVS_EX_INFOTIP = 0x400
  529. Global Const $LVS_EX_LABELTIP = 0x4000
  530. Global Const $LVS_EX_ONECLICKACTIVATE = 0x40
  531. Global Const $LVS_EX_REGIONAL = 0x200
  532. Global Const $LVS_EX_SINGLEROW = 0x40000
  533. Global Const $LVS_EX_TWOCLICKACTIVATE = 0x80
  534. ;~ Global Const $LVS_EX_TRACKSELECT = 0x8
  535. Global Const $LVS_EX_UNDERLINEHOT = 0x800
  536. Global Const $LVS_EX_UNDERLINECOLD = 0x1000
  537.  
  538. ; error
  539. Global Const $LV_ERR = -1
  540.  
  541.  
  542. ; Messages to send to listview
  543. Global Const $CCM_FIRST = 0x2000
  544. Global Const $CCM_GETUNICODEFORMAT = ($CCM_FIRST + 6)
  545. Global Const $CCM_SETUNICODEFORMAT = ($CCM_FIRST + 5)
  546. Global Const $CLR_NONE = 0xFFFFFFFF
  547. Global Const $LVM_FIRST = 0x1000
  548.  
  549. Global Const $LV_VIEW_DETAILS = 0x1
  550. Global Const $LV_VIEW_ICON = 0x0
  551. Global Const $LV_VIEW_LIST = 0x3
  552. Global Const $LV_VIEW_SMALLICON = 0x2
  553. Global Const $LV_VIEW_TILE = 0x4
  554.  
  555. Global Const $LVCF_FMT = 0x1
  556. Global Const $LVCF_WIDTH = 0x2
  557. Global Const $LVCF_TEXT = 0x4
  558. Global Const $LVCFMT_CENTER = 0x2
  559. Global Const $LVCFMT_LEFT = 0x0
  560. Global Const $LVCFMT_RIGHT = 0x1
  561.  
  562. Global Const $LVA_ALIGNLEFT = 0x1
  563. Global Const $LVA_ALIGNTOP = 0x2
  564. Global Const $LVA_DEFAULT = 0x0
  565. Global Const $LVA_SNAPTOGRID = 0x5
  566.  
  567. Global Const $LVIF_STATE = 0x8
  568. Global Const $LVIF_TEXT = 0x1
  569.  
  570. Global Const $LVFI_PARAM = 0x1
  571. Global Const $LVFI_PARTIAL = 0x8
  572. Global Const $LVFI_STRING = 0x2
  573. Global Const $LVFI_WRAP = 0x20
  574.  
  575. Global Const $VK_LEFT = 0x25
  576. Global Const $VK_RIGHT = 0x27
  577. Global Const $VK_UP = 0x26
  578. Global Const $VK_DOWN = 0x28
  579. Global Const $VK_END = 0x23
  580. Global Const $VK_PRIOR = 0x21
  581. Global Const $VK_NEXT = 0x22
  582.  
  583. Global Const $LVIR_BOUNDS = 0
  584.  
  585. Global Const $LVIS_CUT = 0x4
  586. Global Const $LVIS_DROPHILITED = 0x8
  587. Global Const $LVIS_FOCUSED = 0x1
  588. Global Const $LVIS_OVERLAYMASK = 0xF00
  589. Global Const $LVIS_SELECTED = 0x2
  590. Global Const $LVIS_STATEIMAGEMASK = 0xF000
  591.  
  592. Global Const $LVM_ARRANGE = ($LVM_FIRST + 22)
  593. Global Const $LVM_CANCELEDITLABEL = ($LVM_FIRST + 179)
  594. Global Const $LVM_DELETECOLUMN = 0x101C
  595. Global Const $LVM_DELETEITEM = 0x1008
  596. Global Const $LVM_DELETEALLITEMS = 0x1009
  597. Global Const $LVM_EDITLABELA = ($LVM_FIRST + 23)
  598. Global Const $LVM_EDITLABEL = $LVM_EDITLABELA
  599. Global Const $LVM_ENABLEGROUPVIEW = ($LVM_FIRST + 157)
  600. Global Const $LVM_ENSUREVISIBLE = ($LVM_FIRST + 19)
  601. Global Const $LVM_FINDITEM = ($LVM_FIRST + 13)
  602. Global Const $LVM_GETBKCOLOR = ($LVM_FIRST + 0)
  603. Global Const $LVM_GETCALLBACKMASK = ($LVM_FIRST + 10)
  604. Global Const $LVM_GETCOLUMNORDERARRAY = ($LVM_FIRST + 59)
  605. Global Const $LVM_GETCOLUMNWIDTH = ($LVM_FIRST + 29)
  606. Global Const $LVM_GETCOUNTPERPAGE = ($LVM_FIRST + 40)
  607. Global Const $LVM_GETEDITCONTROL = ($LVM_FIRST + 24)
  608. Global Const $LVM_GETEXTENDEDLISTVIEWSTYLE = ($LVM_FIRST + 55)
  609. Global Const $LVM_GETHEADER = ($LVM_FIRST + 31)
  610. Global Const $LVM_GETHOTCURSOR = ($LVM_FIRST + 63)
  611. Global Const $LVM_GETHOTITEM = ($LVM_FIRST + 61)
  612. Global Const $LVM_GETHOVERTIME = ($LVM_FIRST + 72)
  613. Global Const $LVM_GETIMAGELIST = ($LVM_FIRST + 2)
  614. Global Const $LVM_GETITEMA = ($LVM_FIRST + 5)
  615. Global Const $LVM_GETITEMCOUNT = 0x1004
  616. Global Const $LVM_GETITEMSTATE = ($LVM_FIRST + 44)
  617. Global Const $LVM_GETITEMTEXTA = ($LVM_FIRST + 45);
  618. Global Const $LVM_GETNEXTITEM = 0x100c
  619. Global Const $LVM_GETSELECTEDCOLUMN = ($LVM_FIRST + 174)
  620. Global Const $LVM_GETSELECTEDCOUNT = ($LVM_FIRST + 50)
  621. Global Const $LVM_GETSUBITEMRECT = ($LVM_FIRST + 56);
  622. Global Const $LVM_GETTOPINDEX = ($LVM_FIRST + 39)
  623. Global Const $LVM_GETUNICODEFORMAT = $CCM_GETUNICODEFORMAT
  624. Global Const $LVM_GETVIEW = ($LVM_FIRST + 143)
  625. Global Const $LVM_GETVIEWRECT = ($LVM_FIRST + 34)
  626. Global Const $LVM_INSERTCOLUMNA = ($LVM_FIRST + 27)
  627. Global Const $LVM_INSERTITEMA = ($LVM_FIRST + 7)
  628. Global Const $LVM_REDRAWITEMS = ($LVM_FIRST + 21)
  629. Global Const $LVM_SETUNICODEFORMAT = $CCM_SETUNICODEFORMAT
  630. Global Const $LVM_SCROLL = ($LVM_FIRST + 20)
  631. Global Const $LVM_SETBKCOLOR = 0x1001
  632. Global Const $LVM_SETCALLBACKMASK = ($LVM_FIRST + 11)
  633. Global Const $LVM_SETCOLUMNA = ($LVM_FIRST + 26)
  634. Global Const $LVM_SETCOLUMNORDERARRAY = ($LVM_FIRST + 58)
  635. Global Const $LVM_SETCOLUMNWIDTH = 0x101E
  636. Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
  637. Global Const $LVM_SETHOTITEM = ($LVM_FIRST + 60)
  638. Global Const $LVM_SETHOVERTIME = ($LVM_FIRST + 71)
  639. Global Const $LVM_SETICONSPACING = ($LVM_FIRST + 53)
  640. Global Const $LVM_SETITEMCOUNT = ($LVM_FIRST + 47)
  641. Global Const $LVM_SETITEMPOSITION = ($LVM_FIRST + 15)
  642. Global Const $LVM_SETITEMSTATE = ($LVM_FIRST + 43)
  643. Global Const $LVM_SETITEMTEXTA = ($LVM_FIRST + 46)
  644. Global Const $LVM_SETSELECTEDCOLUMN = ($LVM_FIRST + 140)
  645. Global Const $LVM_SETTEXTCOLOR = ($LVM_FIRST + 36)
  646. Global Const $LVM_SETTEXTBKCOLOR = ($LVM_FIRST + 38)
  647. Global Const $LVM_SETVIEW = ($LVM_FIRST + 142)
  648. Global Const $LVM_UPDATE = ($LVM_FIRST + 42)
  649.  
  650. Global Const $LVNI_ABOVE = 0x100
  651. Global Const $LVNI_BELOW = 0x200
  652. Global Const $LVNI_TOLEFT = 0x400
  653. Global Const $LVNI_TORIGHT = 0x800
  654. Global Const $LVNI_ALL = 0x0
  655. Global Const $LVNI_CUT = 0x4
  656. Global Const $LVNI_DROPHILITED = 0x8
  657. Global Const $LVNI_FOCUSED = 0x1
  658. Global Const $LVNI_SELECTED = 0x2
  659.  
  660. Global Const $LVSCW_AUTOSIZE = -1
  661. Global Const $LVSCW_AUTOSIZE_USEHEADER = -2
  662.  
  663. Global Const $LVSICF_NOINVALIDATEALL = 0x1
  664. Global Const $LVSICF_NOSCROLL = 0x2
  665.  
  666. Global Const $LVSIL_NORMAL = 0
  667. Global Const $LVSIL_SMALL = 1
  668. Global Const $LVSIL_STATE = 2
  669.  
  670. ; ----------------------------------------------------------------------------
  671. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ListViewConstants.au3>
  672. ; ----------------------------------------------------------------------------
  673.  
  674.  
  675. ; ----------------------------------------------------------------------------
  676. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\SliderConstants.au3>
  677. ; ----------------------------------------------------------------------------
  678.  
  679.  
  680. ; ------------------------------------------------------------------------------
  681. ;
  682. ; AutoIt Version: 3.2
  683. ; Description:    Slider Constants
  684. ;
  685. ; ------------------------------------------------------------------------------
  686.  
  687. ; Styles
  688. Global Const $TBS_AUTOTICKS = 0x0001
  689. Global Const $TBS_VERT      = 0x0002
  690. Global Const $TBS_HORZ      = 0x0000
  691. Global Const $TBS_TOP       = 0x0004
  692. Global Const $TBS_BOTTOM    = 0x0000
  693. Global Const $TBS_LEFT      = 0x0004
  694. Global Const $TBS_RIGHT     = 0x0000
  695. Global Const $TBS_BOTH      = 0x0008
  696. Global Const $TBS_NOTICKS   = 0x0010
  697. Global Const $TBS_NOTHUMB   = 0x0080
  698.  
  699. ; Messages
  700. Global Const $TWM_USER = 0x400  ; WM_USER
  701. Global Const $TBM_CLEARTICS = ($TWM_USER + 9)
  702. Global Const $TBM_GETLINESIZE = ($TWM_USER + 24)
  703. Global Const $TBM_GETPAGESIZE = ($TWM_USER + 22)
  704. Global Const $TBM_GETNUMTICS = ($TWM_USER + 16)
  705. Global Const $TBM_GETPOS = $TWM_USER
  706. Global Const $TBM_GETRANGEMAX = ($TWM_USER + 2)
  707. Global Const $TBM_GETRANGEMIN = ($TWM_USER + 1)
  708. Global Const $TBM_SETLINESIZE = ($TWM_USER + 23)
  709. Global Const $TBM_SETPAGESIZE = ($TWM_USER + 21)
  710. Global Const $TBM_SETPOS = ($TWM_USER + 5)
  711. Global Const $TBM_SETTICFREQ = ($TWM_USER + 20)
  712.  
  713. ; ----------------------------------------------------------------------------
  714. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\SliderConstants.au3>
  715. ; ----------------------------------------------------------------------------
  716.  
  717.  
  718. ; ----------------------------------------------------------------------------
  719. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\TreeViewConstants.au3>
  720. ; ----------------------------------------------------------------------------
  721.  
  722.  
  723. ; ------------------------------------------------------------------------------
  724. ;
  725. ; AutoIt Version: 3.2
  726. ; Description:    TreeView Constants.
  727. ;
  728. ; ------------------------------------------------------------------------------
  729.  
  730. ; Styles
  731. Global Const $TVS_HASBUTTONS        = 0x0001
  732. Global Const $TVS_HASLINES          = 0x0002
  733. Global Const $TVS_LINESATROOT       = 0x0004
  734. ;Global Const $TVS_EDITLABELS      = 0x0008
  735. Global Const $TVS_DISABLEDRAGDROP   = 0x0010
  736. Global Const $TVS_SHOWSELALWAYS     = 0x0020
  737. ;Global Const $TVS_RTLREADING     = 0x0040
  738. Global Const $TVS_NOTOOLTIPS        = 0x0080
  739. Global Const $TVS_CHECKBOXES        = 0x0100
  740. Global Const $TVS_TRACKSELECT       = 0x0200
  741. Global Const $TVS_SINGLEEXPAND      = 0x0400
  742. ;Global Const $TVS_INFOTIP        = 0x0800
  743. Global Const $TVS_FULLROWSELECT     = 0x1000
  744. Global Const $TVS_NOSCROLL          = 0x2000
  745. Global Const $TVS_NONEVENHEIGHT     = 0x4000
  746.  
  747. Global Const $TVE_COLLAPSE          = 0x0001
  748. Global Const $TVE_EXPAND            = 0x0002
  749. Global Const $TVE_TOGGLE            = 0x0003
  750. Global Const $TVE_EXPANDPARTIAL     = 0x4000
  751. Global Const $TVE_COLLAPSERESET = 0x8000
  752.  
  753. Global Const $TVGN_ROOT             = 0x0000
  754. Global Const $TVGN_NEXT             = 0x0001
  755. Global Const $TVGN_PARENT           = 0x0003
  756. Global Const $TVGN_CHILD            = 0x0004
  757. Global Const $TVGN_CARET            = 0x0009
  758.  
  759. Global Const $TVI_ROOT              = 0xFFFF0000
  760. Global Const $TVI_FIRST             = 0xFFFF0001
  761. Global Const $TVI_LAST              = 0xFFFF0002
  762. Global Const $TVI_SORT              = 0xFFFF0003
  763.  
  764. Global Const $TVIF_TEXT = 0x0001
  765. Global Const $TVIF_IMAGE            = 0x0002
  766. Global Const $TVIF_PARAM            = 0x0004
  767. Global Const $TVIF_STATE            = 0x0008
  768. Global Const $TVIF_HANDLE           = 0x0010
  769. Global Const $TVIF_SELECTEDIMAGE    = 0x0020
  770. Global Const $TVIF_CHILDREN         = 0x0040
  771.  
  772. Global Const $TVIS_SELECTED         = 0x0002
  773. Global Const $TVIS_CUT              = 0x0004
  774. Global Const $TVIS_DROPHILITED      = 0x0008
  775. Global Const $TVIS_BOLD             = 0x0010
  776. Global Const $TVIS_EXPANDED         = 0x0020
  777. Global Const $TVIS_EXPANDEDONCE     = 0x0040
  778. Global Const $TVIS_EXPANDPARTIAL    = 0x0080
  779. Global Const $TVIS_OVERLAYMASK      = 0x0F00
  780. Global Const $TVIS_STATEIMAGEMASK = 0xF000
  781.  
  782. ; Messages to send to TreeView
  783. Global Const $TV_FIRST              = 0x1100
  784. Global Const $TVM_INSERTITEM        = $TV_FIRST + 0
  785. Global Const $TVM_DELETEITEM        = $TV_FIRST + 1
  786. Global Const $TVM_EXPAND            = $TV_FIRST + 2
  787. Global Const $TVM_GETCOUNT          = $TV_FIRST + 5
  788. Global Const $TVM_GETINDENT         = $TV_FIRST + 6
  789. Global Const $TVM_SETINDENT         = $TV_FIRST + 7
  790. Global Const $TVM_GETIMAGELIST      = $TV_FIRST + 8
  791. Global Const $TVM_SETIMAGELIST      = $TV_FIRST + 9
  792. Global Const $TVM_GETNEXTITEM       = $TV_FIRST + 10
  793. Global Const $TVM_SELECTITEM        = $TV_FIRST + 11
  794. Global Const $TVM_GETITEM           = $TV_FIRST + 12
  795. Global Const $TVM_SETITEM           = $TV_FIRST + 13
  796. Global Const $TVM_SORTCHILDREN      = $TV_FIRST + 19
  797. Global Const $TVM_ENSUREVISIBLE     = $TV_FIRST + 20
  798. Global Const $TVM_SETBKCOLOR        = $TV_FIRST + 29
  799. Global Const $TVM_SETTEXTCOLOR      = $TV_FIRST + 30
  800. Global Const $TVM_GETBKCOLOR        = $TV_FIRST + 31
  801. Global Const $TVM_GETTEXTCOLOR      = $TV_FIRST + 32
  802. Global Const $TVM_SETLINECOLOR      = $TV_FIRST + 40
  803. Global Const $TVM_GETLINECOLOR      = $TV_FIRST + 41
  804.  
  805. ; ----------------------------------------------------------------------------
  806. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\TreeViewConstants.au3>
  807. ; ----------------------------------------------------------------------------
  808.  
  809.  
  810. ; ----------------------------------------------------------------------------
  811. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\UpDownConstants.au3>
  812. ; ----------------------------------------------------------------------------
  813.  
  814.  
  815. ; ------------------------------------------------------------------------------
  816. ;
  817. ; AutoIt Version: 3.2
  818. ; Description:    UpDown Constants.
  819. ;
  820. ; ------------------------------------------------------------------------------
  821.  
  822. ; Styles
  823. Global Const $UDS_WRAP              = 0x0001
  824. Global Const $UDS_SETBUDDYINT       = 0x0002
  825. Global Const $UDS_ALIGNRIGHT        = 0x0004
  826. Global Const $UDS_ALIGNLEFT         = 0x0008
  827. Global Const $UDS_ARROWKEYS         = 0x0020
  828. Global Const $UDS_HORZ              = 0x0040
  829. Global Const $UDS_NOTHOUSANDS       = 0x0080
  830.  
  831. ; ----------------------------------------------------------------------------
  832. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\UpDownConstants.au3>
  833. ; ----------------------------------------------------------------------------
  834.  
  835.  
  836. ; Control default styles
  837. Global Const $GUI_SS_DEFAULT_AVI        = $ACS_TRANSPARENT
  838. Global Const $GUI_SS_DEFAULT_BUTTON     = 0
  839. Global Const $GUI_SS_DEFAULT_CHECKBOX   = 0
  840. Global Const $GUI_SS_DEFAULT_COMBO      = BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL)
  841. Global Const $GUI_SS_DEFAULT_DATE       = $DTS_LONGDATEFORMAT
  842. Global Const $GUI_SS_DEFAULT_EDIT       = BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
  843. Global Const $GUI_SS_DEFAULT_GRAPHIC    = 0
  844. Global Const $GUI_SS_DEFAULT_GROUP      = 0
  845. Global Const $GUI_SS_DEFAULT_ICON       = $SS_NOTIFY
  846. Global Const $GUI_SS_DEFAULT_INPUT      = BitOR($ES_LEFT, $ES_AUTOHSCROLL)
  847. Global Const $GUI_SS_DEFAULT_LABEL      = 0
  848. Global Const $GUI_SS_DEFAULT_LIST       = BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY)
  849. Global Const $GUI_SS_DEFAULT_LISTVIEW   = BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL)
  850. Global Const $GUI_SS_DEFAULT_MONTHCAL   = 0
  851. Global Const $GUI_SS_DEFAULT_PIC        = $SS_NOTIFY
  852. Global Const $GUI_SS_DEFAULT_PROGRESS   = 0
  853. Global Const $GUI_SS_DEFAULT_RADIO      = 0
  854. Global Const $GUI_SS_DEFAULT_SLIDER     = $TBS_AUTOTICKS
  855. Global Const $GUI_SS_DEFAULT_TAB        = 0
  856. Global Const $GUI_SS_DEFAULT_TREEVIEW   = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS)
  857. Global Const $GUI_SS_DEFAULT_UPDOWN     = $UDS_ALIGNRIGHT
  858. Global Const $GUI_SS_DEFAULT_GUI        = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
  859.  
  860. ; ----------------------------------------------------------------------------
  861. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\GUIDefaultConstants.au3>
  862. ; ----------------------------------------------------------------------------
  863.  
  864.  
  865. ; ----------------------------------------------------------------------------
  866. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\GUIConstantsEx.au3>
  867. ; ----------------------------------------------------------------------------
  868.  
  869.  
  870. ; ------------------------------------------------------------------------------
  871. ;
  872. ; AutoIt Version: 3.2
  873. ; Description:    Constants to be used in GUI applications.
  874. ;
  875. ; ------------------------------------------------------------------------------
  876.  
  877.  
  878. ; Events and messages
  879. Global Const $GUI_EVENT_CLOSE           = -3
  880. Global Const $GUI_EVENT_MINIMIZE        = -4
  881. Global Const $GUI_EVENT_RESTORE         = -5
  882. Global Const $GUI_EVENT_MAXIMIZE        = -6
  883. Global Const $GUI_EVENT_PRIMARYDOWN     = -7
  884. Global Const $GUI_EVENT_PRIMARYUP       = -8
  885. Global Const $GUI_EVENT_SECONDARYDOWN   = -9
  886. Global Const $GUI_EVENT_SECONDARYUP     = -10
  887. Global Const $GUI_EVENT_MOUSEMOVE       = -11
  888. Global Const $GUI_EVENT_RESIZED         = -12
  889. Global Const $GUI_EVENT_DROPPED         = -13
  890.  
  891. Global Const $GUI_RUNDEFMSG             = 'GUI_RUNDEFMSG'
  892.  
  893. ; State
  894. Global Const $GUI_AVISTOP       = 0
  895. Global Const $GUI_AVISTART      = 1
  896. Global Const $GUI_AVICLOSE      = 2
  897.  
  898. Global Const $GUI_CHECKED       = 1
  899. Global Const $GUI_INDETERMINATE = 2
  900. Global Const $GUI_UNCHECKED     = 4
  901.  
  902. Global Const $GUI_DROPACCEPTED  = 8
  903. Global Const $GUI_NODROPACCEPTED = 4096
  904. Global Const $GUI_ACCEPTFILES   = $GUI_DROPACCEPTED ; to be suppressed
  905.  
  906. Global Const $GUI_SHOW          = 16
  907. Global Const $GUI_HIDE          = 32
  908. Global Const $GUI_ENABLE        = 64
  909. Global Const $GUI_DISABLE       = 128
  910.  
  911. Global Const $GUI_FOCUS         = 256
  912. Global Const $GUI_NOFOCUS       = 8192
  913. Global Const $GUI_DEFBUTTON     = 512
  914.  
  915. Global Const $GUI_EXPAND        = 1024
  916. Global Const $GUI_ONTOP         = 2048
  917.  
  918.  
  919. ; Font
  920. Global Const $GUI_FONTITALIC    = 2
  921. Global Const $GUI_FONTUNDER     = 4
  922. Global Const $GUI_FONTSTRIKE    = 8
  923.  
  924.  
  925. ; Resizing
  926. Global Const $GUI_DOCKAUTO          = 0x0001
  927. Global Const $GUI_DOCKLEFT          = 0x0002
  928. Global Const $GUI_DOCKRIGHT         = 0x0004
  929. Global Const $GUI_DOCKHCENTER       = 0x0008
  930. Global Const $GUI_DOCKTOP           = 0x0020
  931. Global Const $GUI_DOCKBOTTOM        = 0x0040
  932. Global Const $GUI_DOCKVCENTER       = 0x0080
  933. Global Const $GUI_DOCKWIDTH         = 0x0100
  934. Global Const $GUI_DOCKHEIGHT        = 0x0200
  935.  
  936. Global Const $GUI_DOCKSIZE          = 0x0300    ; width+height
  937. Global Const $GUI_DOCKMENUBAR       = 0x0220    ; top+height
  938. Global Const $GUI_DOCKSTATEBAR      = 0x0240    ; bottom+height
  939. Global Const $GUI_DOCKALL           = 0x0322    ; left+top+width+height
  940. Global Const $GUI_DOCKBORDERS       = 0x0066    ; left+top+right+bottom
  941.  
  942. ; Graphic
  943. Global Const $GUI_GR_CLOSE      = 1
  944. Global Const $GUI_GR_LINE       = 2
  945. Global Const $GUI_GR_BEZIER     = 4
  946. Global Const $GUI_GR_MOVE       = 6
  947. Global Const $GUI_GR_COLOR      = 8
  948. Global Const $GUI_GR_RECT       = 10
  949. Global Const $GUI_GR_ELLIPSE    = 12
  950. Global Const $GUI_GR_PIE        = 14
  951. Global Const $GUI_GR_DOT        = 16
  952. Global Const $GUI_GR_PIXEL      = 18
  953. Global Const $GUI_GR_HINT       = 20
  954. Global Const $GUI_GR_REFRESH    = 22
  955. Global Const $GUI_GR_PENSIZE    = 24
  956. Global Const $GUI_GR_NOBKCOLOR  = -2
  957.  
  958. ; Background color special flags
  959. Global Const $GUI_BKCOLOR_DEFAULT = -1
  960. Global Const $GUI_BKCOLOR_TRANSPARENT = -2
  961. Global Const $GUI_BKCOLOR_LV_ALTERNATE = 0xFE000000
  962.  
  963. ; Other
  964. Global Const $GUI_WS_EX_PARENTDRAG =      0x00100000
  965.  
  966. ; ----------------------------------------------------------------------------
  967. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\GUIConstantsEx.au3>
  968. ; ----------------------------------------------------------------------------
  969.  
  970.  
  971. ; ----------------------------------------------------------------------------
  972. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\WindowsConstants.au3>
  973. ; ----------------------------------------------------------------------------
  974.  
  975.  
  976. ; ----------------------------------------------------------------------------
  977. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\WindowsConstants.au3>
  978. ; ----------------------------------------------------------------------------
  979.  
  980.  
  981. ; ----------------------------------------------------------------------------
  982. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ComboConstants.au3>
  983. ; ----------------------------------------------------------------------------
  984.  
  985.  
  986. ; ----------------------------------------------------------------------------
  987. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ComboConstants.au3>
  988. ; ----------------------------------------------------------------------------
  989.  
  990.  
  991. ; ----------------------------------------------------------------------------
  992. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ListViewConstants.au3>
  993. ; ----------------------------------------------------------------------------
  994.  
  995.  
  996. ; ----------------------------------------------------------------------------
  997. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ListViewConstants.au3>
  998. ; ----------------------------------------------------------------------------
  999.  
  1000.  
  1001. ; ----------------------------------------------------------------------------
  1002. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\StaticConstants.au3>
  1003. ; ----------------------------------------------------------------------------
  1004.  
  1005.  
  1006. ; ----------------------------------------------------------------------------
  1007. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\StaticConstants.au3>
  1008. ; ----------------------------------------------------------------------------
  1009.  
  1010.  
  1011. ; ----------------------------------------------------------------------------
  1012. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ButtonConstants.au3>
  1013. ; ----------------------------------------------------------------------------
  1014.  
  1015.  
  1016. ; ------------------------------------------------------------------------------
  1017. ;
  1018. ; AutoIt Version: 3.2
  1019. ; Description:    Button (Group, Radio, Checkbox, Button) Constants.
  1020. ;
  1021. ; ------------------------------------------------------------------------------
  1022.  
  1023. ; Group
  1024. Global Const $BS_GROUPBOX       = 0x0007
  1025.  
  1026. ; Button
  1027. Global Const $BS_BOTTOM         = 0x0800
  1028. Global Const $BS_CENTER         = 0x0300
  1029. Global Const $BS_DEFPUSHBUTTON  = 0x0001
  1030. Global Const $BS_LEFT           = 0x0100
  1031. Global Const $BS_MULTILINE      = 0x2000
  1032. Global Const $BS_PUSHBOX        = 0x000A
  1033. Global Const $BS_PUSHLIKE       = 0x1000
  1034. Global Const $BS_RIGHT          = 0x0200
  1035. Global Const $BS_RIGHTBUTTON    = 0x0020
  1036. Global Const $BS_TOP            = 0x0400
  1037. Global Const $BS_VCENTER        = 0x0C00
  1038. Global Const $BS_FLAT           = 0x8000
  1039. Global Const $BS_ICON           = 0x0040
  1040. Global Const $BS_BITMAP         = 0x0080
  1041. Global Const $BS_NOTIFY         = 0x4000
  1042.  
  1043. ; Checkbox
  1044. Global Const $BS_3STATE         = 0x0005
  1045. Global Const $BS_AUTO3STATE     = 0x0006
  1046. Global Const $BS_AUTOCHECKBOX   = 0x0003
  1047. Global Const $BS_CHECKBOX       = 0x0002
  1048.  
  1049. ; Radio
  1050. Global Const $BS_AUTORADIOBUTTON    = 0x0009
  1051.  
  1052. ; ----------------------------------------------------------------------------
  1053. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ButtonConstants.au3>
  1054. ; ----------------------------------------------------------------------------
  1055.  
  1056.  
  1057. ; ----------------------------------------------------------------------------
  1058. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ListBoxConstants.au3>
  1059. ; ----------------------------------------------------------------------------
  1060.  
  1061.  
  1062. ; ----------------------------------------------------------------------------
  1063. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ListBoxConstants.au3>
  1064. ; ----------------------------------------------------------------------------
  1065.  
  1066.  
  1067. ; ----------------------------------------------------------------------------
  1068. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\TabConstants.au3>
  1069. ; ----------------------------------------------------------------------------
  1070.  
  1071.  
  1072. ; ------------------------------------------------------------------------------
  1073. ;
  1074. ; AutoIt Version: 3.2
  1075. ; Description:    Tab Constants.
  1076. ;
  1077. ; ------------------------------------------------------------------------------
  1078. ; Styles
  1079. Global Const $TCS_SCROLLOPPOSITE    = 0x0001
  1080. Global Const $TCS_BOTTOM            = 0x0002
  1081. Global Const $TCS_RIGHT             = 0x0002
  1082. Global Const $TCS_MULTISELECT       = 0x0004
  1083. Global Const $TCS_FLATBUTTONS       = 0x0008
  1084. Global Const $TCS_FORCEICONLEFT     = 0x0010
  1085. Global Const $TCS_FORCELABELLEFT    = 0x0020
  1086. Global Const $TCS_HOTTRACK          = 0x0040
  1087. Global Const $TCS_VERTICAL          = 0x0080
  1088. Global Const $TCS_TABS              = 0x0000
  1089. Global Const $TCS_BUTTONS           = 0x0100
  1090. Global Const $TCS_SINGLELINE        = 0x0000
  1091. Global Const $TCS_MULTILINE         = 0x0200
  1092. Global Const $TCS_RIGHTJUSTIFY      = 0x0000
  1093. Global Const $TCS_FIXEDWIDTH        = 0x0400
  1094. Global Const $TCS_RAGGEDRIGHT       = 0x0800
  1095. Global Const $TCS_FOCUSONBUTTONDOWN = 0x1000
  1096. Global Const $TCS_OWNERDRAWFIXED    = 0x2000
  1097. Global Const $TCS_TOOLTIPS          = 0x4000
  1098. Global Const $TCS_FOCUSNEVER        = 0x8000
  1099.  
  1100. ; Tab Extended Styles
  1101. Global Const $TCS_EX_FLATSEPARATORS     = 0x1
  1102. ;Global Const $TCS_EX_REGISTERDROP      = 0x2
  1103.  
  1104. ; Error checking
  1105. Global Const $TC_ERR = -1
  1106.  
  1107. ; event(s)
  1108. Global Const $TCIS_BUTTONPRESSED = 0x1
  1109.  
  1110. ; extended styles
  1111. ;~ Global Const $TCS_EX_FLATSEPARATORS = 0x1
  1112. Global Const $TCS_EX_REGISTERDROP = 0x2
  1113.  
  1114. ; Messages to send to Tab control
  1115. Global Const $TCM_FIRST = 0x1300
  1116. Global Const $TCM_DELETEALLITEMS = ($TCM_FIRST + 9)
  1117. Global Const $TCM_DELETEITEM = ($TCM_FIRST + 8)
  1118. Global Const $TCM_DESELECTALL = ($TCM_FIRST + 50)
  1119. Global Const $TCM_GETCURFOCUS = ($TCM_FIRST + 47)
  1120. Global Const $TCM_GETCURSEL = ($TCM_FIRST + 11)
  1121. Global Const $TCM_GETEXTENDEDSTYLE = ($TCM_FIRST + 53)
  1122. Global Const $TCM_GETITEMCOUNT = ($TCM_FIRST + 4)
  1123. Global Const $TCM_GETITEMRECT = ($TCM_FIRST + 10)
  1124. Global Const $TCM_GETROWCOUNT = ($TCM_FIRST + 44)
  1125. Global Const $TCM_SETITEMSIZE = $TCM_FIRST + 41
  1126.  
  1127. Global Const $TCCM_FIRST = 0X2000
  1128. Global Const $TCCM_GETUNICODEFORMAT = ($TCCM_FIRST + 6)
  1129. Global Const $TCM_GETUNICODEFORMAT = $TCCM_GETUNICODEFORMAT
  1130.  
  1131. Global Const $TCM_HIGHLIGHTITEM = ($TCM_FIRST + 51)
  1132. Global Const $TCM_SETCURFOCUS = ($TCM_FIRST + 48)
  1133. Global Const $TCM_SETCURSEL = ($TCM_FIRST + 12)
  1134. Global Const $TCM_SETMINTABWIDTH = ($TCM_FIRST + 49)
  1135. Global Const $TCM_SETPADDING = ($TCM_FIRST + 43)
  1136.  
  1137. Global Const $TCCM_SETUNICODEFORMAT = ($TCCM_FIRST + 5)
  1138. Global Const $TCM_SETUNICODEFORMAT = $TCCM_SETUNICODEFORMAT
  1139.  
  1140. Global Const $TCN_FIRST = -550
  1141. Global Const $TCN_SELCHANGE = ($TCN_FIRST - 1)
  1142. Global Const $TCN_SELCHANGING = ($TCN_FIRST - 2)
  1143.  
  1144. ; ----------------------------------------------------------------------------
  1145. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\TabConstants.au3>
  1146. ; ----------------------------------------------------------------------------
  1147.  
  1148.  
  1149. ; ----------------------------------------------------------------------------
  1150. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\EditConstants.au3>
  1151. ; ----------------------------------------------------------------------------
  1152.  
  1153.  
  1154. ; ----------------------------------------------------------------------------
  1155. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\EditConstants.au3>
  1156. ; ----------------------------------------------------------------------------
  1157.  
  1158.  
  1159. ; ----------------------------------------------------------------------------
  1160. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\DateTimeConstants.au3>
  1161. ; ----------------------------------------------------------------------------
  1162.  
  1163.  
  1164. ; ----------------------------------------------------------------------------
  1165. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\DateTimeConstants.au3>
  1166. ; ----------------------------------------------------------------------------
  1167.  
  1168.  
  1169. ; ----------------------------------------------------------------------------
  1170. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\SliderConstants.au3>
  1171. ; ----------------------------------------------------------------------------
  1172.  
  1173.  
  1174. ; ----------------------------------------------------------------------------
  1175. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\SliderConstants.au3>
  1176. ; ----------------------------------------------------------------------------
  1177.  
  1178.  
  1179. ; ----------------------------------------------------------------------------
  1180. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\TreeViewConstants.au3>
  1181. ; ----------------------------------------------------------------------------
  1182.  
  1183.  
  1184. ; ----------------------------------------------------------------------------
  1185. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\TreeViewConstants.au3>
  1186. ; ----------------------------------------------------------------------------
  1187.  
  1188.  
  1189. ; ----------------------------------------------------------------------------
  1190. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\ProgressConstants.au3>
  1191. ; ----------------------------------------------------------------------------
  1192.  
  1193.  
  1194. ; ------------------------------------------------------------------------------
  1195. ;
  1196. ; AutoIt Version: 3.2
  1197. ; Description:    Progress Constants.
  1198. ;
  1199. ; ------------------------------------------------------------------------------
  1200.  
  1201. ; Styles
  1202. Global Const $PBS_SMOOTH    = 1
  1203. Global Const $PBS_VERTICAL  = 4
  1204.  
  1205. ; ----------------------------------------------------------------------------
  1206. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\ProgressConstants.au3>
  1207. ; ----------------------------------------------------------------------------
  1208.  
  1209.  
  1210. ; ----------------------------------------------------------------------------
  1211. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\AVIConstants.au3>
  1212. ; ----------------------------------------------------------------------------
  1213.  
  1214.  
  1215. ; ----------------------------------------------------------------------------
  1216. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\AVIConstants.au3>
  1217. ; ----------------------------------------------------------------------------
  1218.  
  1219.  
  1220. ; ----------------------------------------------------------------------------
  1221. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\UpDownConstants.au3>
  1222. ; ----------------------------------------------------------------------------
  1223.  
  1224.  
  1225. ; ----------------------------------------------------------------------------
  1226. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\UpDownConstants.au3>
  1227. ; ----------------------------------------------------------------------------
  1228.  
  1229.  
  1230. ; ----------------------------------------------------------------------------
  1231. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\GUIConstants.au3>
  1232. ; ----------------------------------------------------------------------------
  1233.  
  1234.  
  1235. ; ----------------------------------------------------------------------------
  1236. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\beta\Include\Date.au3>
  1237. ; ----------------------------------------------------------------------------
  1238.  
  1239. ;
  1240. ; ------------------------------------------------------------------------------
  1241. ;
  1242. ; AutoIt Version: 3.0
  1243. ; Language:       English
  1244. ; Description:    Functions that assist with dates and times.
  1245. ;
  1246. ;===============================================================================
  1247. ;
  1248. ; Description:      Calculates a new date based on a given date and add an interval.
  1249. ; Parameter(s):     $sType    D = Add number of days to the given date
  1250. ;                             M = Add number of months to the given date
  1251. ;                             Y = Add number of years to the given date
  1252. ;                             w = Add number of Weeks to the given date
  1253. ;                             h = Add number of hours to the given date
  1254. ;                             n = Add number of minutes to the given date
  1255. ;                             s = Add number of seconds to the given date
  1256. ;                   $iValToAdd - number to be added
  1257. ;                   $sDate    - Input date in the format YYYY/MM/DD[ HH:MM:SS]
  1258. ; Requirement(s):   None
  1259. ; Return Value(s):  On Success - Date newly calculated date.
  1260. ;                   On Failure - 0  and Set
  1261. ;                                   @ERROR to:  1 - Invalid $sType
  1262. ;                                                  2 - Invalid $iValToAdd
  1263. ;                                                  3 - Invalid $sDate
  1264. ; Author(s):        Jos van der Zande
  1265. ; Note(s):          The function will not return an invalid date.
  1266. ;                   When 3 months is are to '2004/1/31' then the result will be 2004/04/30
  1267. ;
  1268. ;
  1269. ;===============================================================================
  1270. Func _DateAdd($sType, $iValToAdd, $sDate)
  1271.     Local $asTimePart[4]
  1272.     Local $asDatePart[4]
  1273.     Local $iJulianDate
  1274.     Local $iTimeVal
  1275.     Local $iNumDays
  1276.     Local $Day2Add
  1277.     ; Verify that $sType is Valid
  1278.     $sType = StringLeft($sType, 1)
  1279.     If StringInStr("D,M,Y,w,h,n,s", $sType) = 0 Or $sType = "" Then
  1280.         SetError(1)
  1281.         Return (0)
  1282.     EndIf
  1283.     ; Verify that Value to Add  is Valid
  1284.     If Not StringIsInt($iValToAdd) Then
  1285.         SetError(2)
  1286.         Return (0)
  1287.     EndIf
  1288.     ; Verify If InputDate is valid
  1289.     If Not _DateIsValid($sDate) Then
  1290.         SetError(3)
  1291.         Return (0)
  1292.     EndIf
  1293.     ; split the date and time into arrays
  1294.     _DateTimeSplit($sDate, $asDatePart, $asTimePart)
  1295.  
  1296.     ; ====================================================
  1297.     ; adding days then get the julian date
  1298.     ; add the number of day
  1299.     ; and convert back to Gregorian
  1300.     If $sType = "d" Or $sType = "w" Then
  1301.         If $sType = "w" Then $iValToAdd = $iValToAdd * 7
  1302.         $iJulianDate = _DateToDayValue($asDatePart[1], $asDatePart[2], $asDatePart[3]) + $iValToAdd
  1303.         _DayValueToDate($iJulianDate, $asDatePart[1], $asDatePart[2], $asDatePart[3])
  1304.     EndIf
  1305.     ; ====================================================
  1306.     ; adding Months
  1307.     If $sType = "m" Then
  1308.         $asDatePart[2] = $asDatePart[2] + $iValToAdd
  1309.         ; pos number of months
  1310.         While $asDatePart[2] > 12
  1311.             $asDatePart[2] = $asDatePart[2] - 12
  1312.             $asDatePart[1] = $asDatePart[1] + 1
  1313.         WEnd
  1314.         ; Neg number of months
  1315.         While $asDatePart[2] < 1
  1316.             $asDatePart[2] = $asDatePart[2] + 12
  1317.             $asDatePart[1] = $asDatePart[1] - 1
  1318.         WEnd
  1319.     EndIf
  1320.     ; ====================================================
  1321.     ; adding Years
  1322.     If $sType = "y" Then
  1323.         $asDatePart[1] = $asDatePart[1] + $iValToAdd
  1324.     EndIf
  1325.     ; ====================================================
  1326.     ; adding Time value
  1327.     If $sType = "h" Or $sType = "n" Or $sType = "s" Then
  1328.         $iTimeVal = _TimeToTicks($asTimePart[1], $asTimePart[2], $asTimePart[3]) / 1000
  1329.         If $sType = "h" Then $iTimeVal = $iTimeVal + $iValToAdd * 3600
  1330.         If $sType = "n" Then $iTimeVal = $iTimeVal + $iValToAdd * 60
  1331.         If $sType = "s" Then $iTimeVal = $iTimeVal + $iValToAdd
  1332.         ; calculated days to add
  1333.         $Day2Add = Int($iTimeVal/ (24 * 60 * 60))
  1334.         $iTimeVal = $iTimeVal - $Day2Add * 24 * 60 * 60
  1335.         If $iTimeVal < 0 Then
  1336.             $Day2Add = $Day2Add - 1
  1337.             $iTimeVal = $iTimeVal + 24 * 60 * 60
  1338.         EndIf
  1339.         $iJulianDate = _DateToDayValue($asDatePart[1], $asDatePart[2], $asDatePart[3]) + $Day2Add
  1340.         ; calculate the julian back to date
  1341.         _DayValueToDate($iJulianDate, $asDatePart[1], $asDatePart[2], $asDatePart[3])
  1342.         ; caluculate the new time
  1343.         _TicksToTime($iTimeVal * 1000, $asTimePart[1], $asTimePart[2], $asTimePart[3])
  1344.     EndIf
  1345.     ; ====================================================
  1346.     ; check if the Input day is Greater then the new month last day.
  1347.     ; if so then change it to the last possible day in the month
  1348.     $iNumDays = StringSplit('31,28,31,30,31,30,31,31,30,31,30,31', ',')
  1349.     If _DateIsLeapYear($asDatePart[1]) Then $iNumDays[2] = 29
  1350.     ;
  1351.     If $iNumDays[$asDatePart[2]] < $asDatePart[3] Then $asDatePart[3] = $iNumDays[$asDatePart[2]]
  1352.     ; ========================
  1353.     ; Format the return date
  1354.     ; ========================
  1355.     ; Format the return date
  1356.     $sDate = $asDatePart[1] & '/' & StringRight("0" & $asDatePart[2], 2) & '/' & StringRight("0" & $asDatePart[3], 2)
  1357.     ; add the time when specified in the input
  1358.     If $asTimePart[0] > 0 Then
  1359.         If $asTimePart[0] > 2 Then
  1360.             $sDate = $sDate & " " & StringRight("0" & $asTimePart[1], 2) & ':' & StringRight("0" & $asTimePart[2], 2) & ':' & StringRight("0" & $asTimePart[3], 2)
  1361.         Else
  1362.             $sDate = $sDate & " " & StringRight("0" & $asTimePart[1], 2) & ':' & StringRight("0" & $asTimePart[2], 2)
  1363.         EndIf
  1364.     EndIf
  1365.     ;
  1366.     Return ($sDate)
  1367. EndFunc   ;==>_DateAdd
  1368.  
  1369. ;===============================================================================
  1370. ;
  1371. ; Description:      Returns the name of the weekday, based on the specified day.
  1372. ; Parameter(s):     $iDayNum - Day number
  1373. ;                   $iShort  - Format:
  1374. ;                              0 = Long name of the weekday
  1375. ;                              1 = Abbreviated name of the weekday
  1376. ; Requirement(s):   None
  1377. ; Return Value(s):  On Success - Weekday name
  1378. ;                   On Failure - A NULL string and sets @ERROR = 1
  1379. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1380. ; Note(s):          English only
  1381. ;
  1382. ;===============================================================================
  1383. Func _DateDayOfWeek($iDayNum, $iShort = 0)
  1384.     ;==============================================
  1385.     ; Local Constant/Variable Declaration Section
  1386.     ;==============================================
  1387.     Local $aDayOfWeek[8]
  1388.  
  1389.     $aDayOfWeek[1] = "Sunday"
  1390.     $aDayOfWeek[2] = "Monday"
  1391.     $aDayOfWeek[3] = "Tuesday"
  1392.     $aDayOfWeek[4] = "Wednesday"
  1393.     $aDayOfWeek[5] = "Thursday"
  1394.     $aDayOfWeek[6] = "Friday"
  1395.     $aDayOfWeek[7] = "Saturday"
  1396.     Select
  1397.         Case Not StringIsInt($iDayNum) Or Not StringIsInt($iShort)
  1398.             SetError(1)
  1399.             Return ""
  1400.         Case $iDayNum < 1 Or $iDayNum > 7
  1401.             SetError(1)
  1402.             Return ""
  1403.         Case Else
  1404.             Select
  1405.                 Case $iShort = 0
  1406.                     Return $aDayOfWeek[$iDayNum]
  1407.                 Case $iShort = 1
  1408.                     Return StringLeft($aDayOfWeek[$iDayNum], 3)
  1409.                 Case Else
  1410.                     SetError(1)
  1411.                     Return ""
  1412.             EndSelect
  1413.     EndSelect
  1414. EndFunc   ;==>_DateDayOfWeek
  1415.  
  1416. ;===============================================================================
  1417. ;
  1418. ; Function Name:  _DateDaysInMonth()
  1419. ; Description:    Returns the number of days in a month, based on the specified
  1420. ;                 month and year.
  1421. ; Author(s):      Jeremy Landes <jlandes at landeserve dot com>
  1422. ;
  1423. ;===============================================================================
  1424. Func _DateDaysInMonth($iYear, $iMonthNum)
  1425.     Local $aiNumDays
  1426.     $aiNumDays = "31,28,31,30,31,30,31,31,30,31,30,31"
  1427.     $aiNumDays = StringSplit($aiNumDays, ",")
  1428.     If _DateIsMonth($iMonthNum) And _DateIsYear($iYear) Then
  1429.         If _DateIsLeapYear($iYear) Then $aiNumDays[2] = $aiNumDays[2] + 1
  1430.         SetError(0)
  1431.         Return $aiNumDays[$iMonthNum]
  1432.     Else
  1433.         SetError(1)
  1434.         Return 0
  1435.     EndIf
  1436. EndFunc   ;==>_DateDaysInMonth
  1437.  
  1438. ;===============================================================================
  1439. ;
  1440. ; Description:      Returns the difference between 2 dates, expressed in the type requested
  1441. ; Parameter(s):     $sType - returns the difference in:
  1442. ;                               d = days
  1443. ;                               m = Months
  1444. ;                               y = Years
  1445. ;                               w = Weeks
  1446. ;                               h = Hours
  1447. ;                               n = Minutes
  1448. ;                               s = Seconds
  1449. ;                   $sStartDate    - Input Start date in the format "YYYY/MM/DD[ HH:MM:SS]"
  1450. ;                   $sEndDate    - Input End date in the format "YYYY/MM/DD[ HH:MM:SS]"
  1451. ; Requirement(s):   None
  1452. ; Return Value(s):  On Success - Difference between the 2 dates
  1453. ;                   On Failure - 0  and Set
  1454. ;                                   @ERROR to:  1 - Invalid $sType
  1455. ;                                               2 - Invalid $sStartDate
  1456. ;                                               3 - Invalid $sEndDate
  1457. ; Author(s):        Jos van der Zande
  1458. ; Note(s):
  1459. ;
  1460. ;===============================================================================
  1461. Func _DateDiff($sType, $sStartDate, $sEndDate)
  1462.     Local $asStartDatePart[4]
  1463.     Local $asStartTimePart[4]
  1464.     Local $asEndDatePart[4]
  1465.     Local $asEndTimePart[4]
  1466.     Local $iTimeDiff
  1467.     Local $iYearDiff
  1468.     Local $iMonthDiff
  1469.     Local $iStartTimeInSecs
  1470.     Local $iEndTimeInSecs
  1471.     Local $aDaysDiff
  1472.     ;
  1473.     ; Verify that $sType is Valid
  1474.     $sType = StringLeft($sType, 1)
  1475.     If StringInStr("d,m,y,w,h,n,s", $sType) = 0 Or $sType = "" Then
  1476.         SetError(1)
  1477.         Return (0)
  1478.     EndIf
  1479.     ; Verify If StartDate is valid
  1480.     If Not _DateIsValid($sStartDate) Then
  1481.         SetError(2)
  1482.         Return (0)
  1483.     EndIf
  1484.     ; Verify If EndDate is valid
  1485.     If Not _DateIsValid($sEndDate) Then
  1486.         SetError(3)
  1487.         Return (0)
  1488.     EndIf
  1489.     ; split the StartDate and Time into arrays
  1490.     _DateTimeSplit($sStartDate, $asStartDatePart, $asStartTimePart)
  1491.     ; split the End  Date and time into arrays
  1492.     _DateTimeSplit($sEndDate, $asEndDatePart, $asEndTimePart)
  1493.     ; ====================================================
  1494.     ; Get the differens in days between the 2 dates
  1495.     $aDaysDiff = _DateToDayValue($asEndDatePart[1], $asEndDatePart[2], $asEndDatePart[3]) - _DateToDayValue($asStartDatePart[1], $asStartDatePart[2], $asStartDatePart[3])
  1496.     ; ====================================================
  1497.     ; Get the differens in Seconds between the 2 times when specified
  1498.     If $asStartTimePart[0] > 1 And $asEndTimePart[0] > 1 Then
  1499.         $iStartTimeInSecs = $asStartTimePart[1] * 3600 + $asStartTimePart[2] * 60 + $asStartTimePart[3]
  1500.         $iEndTimeInSecs = $asEndTimePart[1] * 3600 + $asEndTimePart[2] * 60 + $asEndTimePart[3]
  1501.         $iTimeDiff = $iEndTimeInSecs - $iStartTimeInSecs
  1502.         If $iTimeDiff < 0 Then
  1503.             $aDaysDiff = $aDaysDiff - 1
  1504.             $iTimeDiff = $iTimeDiff + 24 * 60 * 60
  1505.         EndIf
  1506.     Else
  1507.         $iTimeDiff = 0
  1508.     EndIf
  1509.     Select
  1510.         Case $sType = "d"
  1511.             Return ($aDaysDiff)
  1512.         Case $sType = "m"
  1513.             $iYearDiff = $asEndDatePart[1] - $asStartDatePart[1]
  1514.             $iMonthDiff = $asEndDatePart[2] - $asStartDatePart[2] + $iYearDiff * 12
  1515.             If $asEndDatePart[3] < $asStartDatePart[3] Then $iMonthDiff = $iMonthDiff - 1
  1516.             $iStartTimeInSecs = $asStartTimePart[1] * 3600 + $asStartTimePart[2] * 60 + $asStartTimePart[3]
  1517.             $iEndTimeInSecs = $asEndTimePart[1] * 3600 + $asEndTimePart[2] * 60 + $asEndTimePart[3]
  1518.             $iTimeDiff = $iEndTimeInSecs - $iStartTimeInSecs
  1519.             If $asEndDatePart[3] = $asStartDatePart[3] And $iTimeDiff < 0 Then $iMonthDiff = $iMonthDiff - 1
  1520.             Return ($iMonthDiff)
  1521.         Case $sType = "y"
  1522.             $iYearDiff = $asEndDatePart[1] - $asStartDatePart[1]
  1523.             If $asEndDatePart[2] < $asStartDatePart[2] Then $iYearDiff = $iYearDiff - 1
  1524.             If $asEndDatePart[2] = $asStartDatePart[2] And $asEndDatePart[3] < $asStartDatePart[3] Then $iYearDiff = $iYearDiff - 1
  1525.             $iStartTimeInSecs = $asStartTimePart[1] * 3600 + $asStartTimePart[2] * 60 + $asStartTimePart[3]
  1526.             $iEndTimeInSecs = $asEndTimePart[1] * 3600 + $asEndTimePart[2] * 60 + $asEndTimePart[3]
  1527.             $iTimeDiff = $iEndTimeInSecs - $iStartTimeInSecs
  1528.             If $asEndDatePart[2] = $asStartDatePart[2] And $asEndDatePart[3] = $asStartDatePart[3] And $iTimeDiff < 0 Then $iYearDiff = $iYearDiff - 1
  1529.             Return ($iYearDiff)
  1530.         Case $sType = "w"
  1531.             Return (Int($aDaysDiff / 7))
  1532.         Case $sType = "h"
  1533.             Return ($aDaysDiff * 24 + Int($iTimeDiff / 3600))
  1534.         Case $sType = "n"
  1535.             Return ($aDaysDiff * 24 * 60 + Int($iTimeDiff / 60))
  1536.         Case $sType = "s"
  1537.             Return ($aDaysDiff * 24 * 60 * 60 + $iTimeDiff)
  1538.     EndSelect
  1539. EndFunc   ;==>_DateDiff
  1540.  
  1541. ;===============================================================================
  1542. ;
  1543. ; Description:      Returns 1 if the specified year falls on a leap year and
  1544. ;                   returns 0 if it does not.
  1545. ; Parameter(s):     $iYear - Year to check
  1546. ; Requirement(s):   None
  1547. ; Return Value(s):  On Success - 0 = Year is not a leap year
  1548. ;                                1 = Year is a leap year
  1549. ;                   On Failure - 0 and sets @ERROR = 1
  1550. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1551. ; Note(s):          None
  1552. ;
  1553. ;===============================================================================
  1554. Func _DateIsLeapYear($iYear)
  1555.     If StringIsInt($iYear) Then
  1556.         Select
  1557.             Case Mod($iYear, 4) = 0 And Mod($iYear, 100) <> 0
  1558.                 Return 1
  1559.             Case Mod($iYear, 400) = 0
  1560.                 Return 1
  1561.             Case Else
  1562.                 Return 0
  1563.         EndSelect
  1564.     Else
  1565.         SetError(1)
  1566.         Return 0
  1567.     EndIf
  1568. EndFunc   ;==>_DateIsLeapYear
  1569.  
  1570. ;===============================================================================
  1571. ;
  1572. ; Function Name:  _DateIsMonth()
  1573. ; Description:    Checks a given number to see if it is a valid month.
  1574. ; Author(s):      Jeremy Landes <jlandes at landeserve dot com>
  1575. ;
  1576. ;===============================================================================
  1577. Func _DateIsMonth($iNumber)
  1578.     If StringIsInt($iNumber) Then
  1579.         If $iNumber >= 1 And $iNumber <= 12 Then
  1580.             Return 1
  1581.         Else
  1582.             Return 0
  1583.         EndIf
  1584.     Else
  1585.         Return 0
  1586.     EndIf
  1587. EndFunc   ;==>_DateIsMonth
  1588.  
  1589. ;===============================================================================
  1590. ;
  1591. ; Description:      Verify if date and time are valid "yyyy/mm/dd[ hh:mm[:ss]]".
  1592. ; Parameter(s):     $sDate format "yyyy/mm/dd[ hh:mm[:ss]]"
  1593. ; Requirement(s):   None
  1594. ; Return Value(s):  On Success - 1
  1595. ;                   On Failure - 0
  1596. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1597. ;                   Jos van der Zande <jdeb at autoitscript dot com>
  1598. ; Note(s):          None
  1599. ;
  1600. ;===============================================================================
  1601. Func _DateIsValid($sDate)
  1602.     Local $asDatePart[4]
  1603.     Local $asTimePart[4]
  1604.     Local $iNumDays
  1605.     $iNumDays = "31,28,31,30,31,30,31,31,30,31,30,31"
  1606.     $iNumDays = StringSplit($iNumDays, ",")
  1607.     ; split the date and time into arrays
  1608.     _DateTimeSplit($sDate, $asDatePart, $asTimePart)
  1609.     If $asDatePart[0] <> 3 Then
  1610.         Return (0)
  1611.     EndIf
  1612.     ; verify valid input date values
  1613.     If _DateIsLeapYear($asDatePart[1]) Then $iNumDays[2] = 29
  1614.     If $asDatePart[1] < 1000 Or $asDatePart[1] > 2999 Then Return (0)
  1615.     If $asDatePart[2] < 1 Or $asDatePart[2] > 12 Then Return (0)
  1616.     If $asDatePart[3] < 1 Or $asDatePart[3] > $iNumDays[$asDatePart[2]] Then Return (0)
  1617.  
  1618.     ; verify valid input Time values
  1619.     If $asTimePart[0] < 1 Then Return (1)    ; No time specified so date must be correct
  1620.     If $asTimePart[0] < 2 Then Return (0)    ; need at least HH:MM when something is specified
  1621.     If $asTimePart[1] < 0 Or $asTimePart[1] > 23 Then Return (0)
  1622.     If $asTimePart[2] < 0 Or $asTimePart[2] > 59 Then Return (0)
  1623.     If $asTimePart[3] < 0 Or $asTimePart[3] > 59 Then Return (0)
  1624.     ; we got here so date/time must be good
  1625.     Return (1)
  1626. EndFunc   ;==>_DateIsValid
  1627.  
  1628. ;===============================================================================
  1629. ;
  1630. ; Function Name:  _DateIsYear()
  1631. ; Description:    Checks a given number to see if it is a valid year.
  1632. ; Author(s):      Jeremy Landes <jlandes at landeserve dot com>
  1633. ;
  1634. ;===============================================================================
  1635. Func _DateIsYear($iNumber)
  1636.     If StringIsInt($iNumber) Then
  1637.         If StringLen($iNumber) = 4 Then
  1638.             Return 1
  1639.         Else
  1640.             Return 0
  1641.         EndIf
  1642.     Else
  1643.         Return 0
  1644.     EndIf
  1645. EndFunc   ;==>_DateIsYear
  1646.  
  1647. ;===============================================================================
  1648. ;
  1649. ; Description:      Returns previous weekday number, based on the specified day
  1650. ;                   of the week.
  1651. ; Parameter(s):     $iWeekdayNum - Weekday number
  1652. ; Requirement(s):   None
  1653. ; Return Value(s):  On Success - Previous weekday number
  1654. ;                   On Failure - 0 and sets @ERROR = 1
  1655. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1656. ; Note(s):          None
  1657. ;
  1658. ;===============================================================================
  1659. Func _DateLastWeekdayNum($iWeekdayNum)
  1660.     ;==============================================
  1661.     ; Local Constant/Variable Declaration Section
  1662.     ;==============================================
  1663.     Local $iLastWeekdayNum
  1664.  
  1665.     Select
  1666.         Case Not StringIsInt($iWeekdayNum)
  1667.             SetError(1)
  1668.             Return 0
  1669.         Case $iWeekdayNum < 1 Or $iWeekdayNum > 7
  1670.             SetError(1)
  1671.             Return 0
  1672.         Case Else
  1673.             If $iWeekdayNum = 1 Then
  1674.                 $iLastWeekdayNum = 7
  1675.             Else
  1676.                 $iLastWeekdayNum = $iWeekdayNum - 1
  1677.             EndIf
  1678.  
  1679.             Return $iLastWeekdayNum
  1680.     EndSelect
  1681. EndFunc   ;==>_DateLastWeekdayNum
  1682.  
  1683. ;===============================================================================
  1684. ;
  1685. ; Description:      Returns previous month number, based on the specified month.
  1686. ; Parameter(s):     $iMonthNum - Month number
  1687. ; Requirement(s):   None
  1688. ; Return Value(s):  On Success - Previous month number
  1689. ;                   On Failure - 0 and sets @ERROR = 1
  1690. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1691. ; Note(s):          None
  1692. ;
  1693. ;===============================================================================
  1694. Func _DateLastMonthNum($iMonthNum)
  1695.     ;==============================================
  1696.     ; Local Constant/Variable Declaration Section
  1697.     ;==============================================
  1698.     Local $iLastMonthNum
  1699.  
  1700.     Select
  1701.         Case Not StringIsInt($iMonthNum)
  1702.             SetError(1)
  1703.             Return 0
  1704.         Case $iMonthNum < 1 Or $iMonthNum > 12
  1705.             SetError(1)
  1706.             Return 0
  1707.         Case Else
  1708.             If $iMonthNum = 1 Then
  1709.                 $iLastMonthNum = 12
  1710.             Else
  1711.                 $iLastMonthNum = $iMonthNum - 1
  1712.             EndIf
  1713.  
  1714.             $iLastMonthNum = StringFormat("%02d", $iLastMonthNum)
  1715.             Return $iLastMonthNum
  1716.     EndSelect
  1717. EndFunc   ;==>_DateLastMonthNum
  1718.  
  1719. ;===============================================================================
  1720. ;
  1721. ; Description:      Returns previous month's year, based on the specified month
  1722. ;                   and year.
  1723. ; Parameter(s):     $iMonthNum - Month number
  1724. ;                   $iYear     - Year
  1725. ; Requirement(s):   None
  1726. ; Return Value(s):  On Success - Previous month's year
  1727. ;                   On Failure - 0 and sets @ERROR = 1
  1728. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1729. ; Note(s):          None
  1730. ;
  1731. ;===============================================================================
  1732. Func _DateLastMonthYear($iMonthNum, $iYear)
  1733.     ;==============================================
  1734.     ; Local Constant/Variable Declaration Section
  1735.     ;==============================================
  1736.     Local $iLastYear
  1737.  
  1738.     Select
  1739.         Case Not StringIsInt($iMonthNum) Or Not StringIsInt($iYear)
  1740.             SetError(1)
  1741.             Return 0
  1742.         Case $iMonthNum < 1 Or $iMonthNum > 12
  1743.             SetError(1)
  1744.             Return 0
  1745.         Case Else
  1746.             If $iMonthNum = 1 Then
  1747.                 $iLastYear = $iYear - 1
  1748.             Else
  1749.                 $iLastYear = $iYear
  1750.             EndIf
  1751.  
  1752.             $iLastYear = StringFormat("%04d", $iLastYear)
  1753.             Return $iLastYear
  1754.     EndSelect
  1755. EndFunc   ;==>_DateLastMonthYear
  1756.  
  1757. ;===============================================================================
  1758. ;
  1759. ; Description:      Returns the name of the month, based on the specified month.
  1760. ; Parameter(s):     $iMonthNum - Month number
  1761. ;                   $iShort    - Format:
  1762. ;                                0 = Long name of the month
  1763. ;                                1 = Abbreviated name of the month
  1764. ; Requirement(s):   None
  1765. ; Return Value(s):  On Success - Month name
  1766. ;                   On Failure - A NULL string and sets @ERROR = 1
  1767. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1768. ; Note(s):          English only
  1769. ;
  1770. ;===============================================================================
  1771. Func _DateMonthOfYear($iMonthNum, $iShort)
  1772.     ;==============================================
  1773.     ; Local Constant/Variable Declaration Section
  1774.     ;==============================================
  1775.     Local $aMonthOfYear[13]
  1776.  
  1777.     $aMonthOfYear[1] = "January"
  1778.     $aMonthOfYear[2] = "February"
  1779.     $aMonthOfYear[3] = "March"
  1780.     $aMonthOfYear[4] = "April"
  1781.     $aMonthOfYear[5] = "May"
  1782.     $aMonthOfYear[6] = "June"
  1783.     $aMonthOfYear[7] = "July"
  1784.     $aMonthOfYear[8] = "August"
  1785.     $aMonthOfYear[9] = "September"
  1786.     $aMonthOfYear[10] = "October"
  1787.     $aMonthOfYear[11] = "November"
  1788.     $aMonthOfYear[12] = "December"
  1789.  
  1790.     Select
  1791.         Case Not StringIsInt($iMonthNum) Or Not StringIsInt($iShort)
  1792.             SetError(1)
  1793.             Return ""
  1794.         Case $iMonthNum < 1 Or $iMonthNum > 12
  1795.             SetError(1)
  1796.             Return ""
  1797.         Case Else
  1798.             Select
  1799.                 Case $iShort = 0
  1800.                     Return $aMonthOfYear[$iMonthNum]
  1801.                 Case $iShort = 1
  1802.                     Return StringLeft($aMonthOfYear[$iMonthNum], 3)
  1803.                 Case Else
  1804.                     SetError(1)
  1805.                     Return ""
  1806.             EndSelect
  1807.     EndSelect
  1808. EndFunc   ;==>_DateMonthOfYear
  1809.  
  1810. ;===============================================================================
  1811. ;
  1812. ; Description:      Returns next weekday number, based on the specified day of
  1813. ;                   the week.
  1814. ; Parameter(s):     $iWeekdayNum - Weekday number
  1815. ; Requirement(s):   None
  1816. ; Return Value(s):  On Success - Next weekday number
  1817. ;                   On Failure - 0 and sets @ERROR = 1
  1818. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1819. ; Note(s):          None
  1820. ;
  1821. ;===============================================================================
  1822. Func _DateNextWeekdayNum($iWeekdayNum)
  1823.     ;==============================================
  1824.     ; Local Constant/Variable Declaration Section
  1825.     ;==============================================
  1826.     Local $iNextWeekdayNum
  1827.  
  1828.     Select
  1829.         Case Not StringIsInt($iWeekdayNum)
  1830.             SetError(1)
  1831.             Return 0
  1832.         Case $iWeekdayNum < 1 Or $iWeekdayNum > 7
  1833.             SetError(1)
  1834.             Return 0
  1835.         Case Else
  1836.             If $iWeekdayNum = 7 Then
  1837.                 $iNextWeekdayNum = 1
  1838.             Else
  1839.                 $iNextWeekdayNum = $iWeekdayNum + 1
  1840.             EndIf
  1841.  
  1842.             Return $iNextWeekdayNum
  1843.     EndSelect
  1844. EndFunc   ;==>_DateNextWeekdayNum
  1845.  
  1846. ;===============================================================================
  1847. ;
  1848. ; Description:      Returns next month number, based on the specified month.
  1849. ; Parameter(s):     $iMonthNum - Month number
  1850. ; Requirement(s):   None
  1851. ; Return Value(s):  On Success - Next month number
  1852. ;                   On Failure - 0 and sets @ERROR = 1
  1853. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1854. ; Note(s):          None
  1855. ;
  1856. ;===============================================================================
  1857. Func _DateNextMonthNum($iMonthNum)
  1858.     ;==============================================
  1859.     ; Local Constant/Variable Declaration Section
  1860.     ;==============================================
  1861.     Local $iNextMonthNum
  1862.  
  1863.     Select
  1864.         Case Not StringIsInt($iMonthNum)
  1865.             SetError(1)
  1866.             Return 0
  1867.         Case $iMonthNum < 1 Or $iMonthNum > 12
  1868.             SetError(1)
  1869.             Return 0
  1870.         Case Else
  1871.             If $iMonthNum = 12 Then
  1872.                 $iNextMonthNum = 1
  1873.             Else
  1874.                 $iNextMonthNum = $iMonthNum + 1
  1875.             EndIf
  1876.  
  1877.             $iNextMonthNum = StringFormat("%02d", $iNextMonthNum)
  1878.             Return $iNextMonthNum
  1879.     EndSelect
  1880. EndFunc   ;==>_DateNextMonthNum
  1881.  
  1882. ;===============================================================================
  1883. ;
  1884. ; Description:      Returns next month's year, based on the specified month and
  1885. ;                   year.
  1886. ; Parameter(s):     $iMonthNum - Month number
  1887. ;                   $iYear     - Year
  1888. ; Requirement(s):   None
  1889. ; Return Value(s):  On Success - Next month's year
  1890. ;                   On Failure - 0 and sets @ERROR = 1
  1891. ; Author(s):        Jeremy Landes <jlandes at landeserve dot com>
  1892. ; Note(s):          None
  1893. ;
  1894. ;===============================================================================
  1895. Func _DateNextMonthYear($iMonthNum, $iYear)
  1896.     ;==============================================
  1897.     ; Local Constant/Variable Declaration Section
  1898.     ;==============================================
  1899.     Local $iNextYear
  1900.  
  1901.     Select
  1902.         Case Not StringIsInt($iMonthNum) Or Not StringIsInt($iYear)
  1903.             SetError(1)
  1904.             Return 0
  1905.         Case $iMonthNum < 1 Or $iMonthNum > 12
  1906.             SetError(1)
  1907.             Return 0
  1908.         Case Else
  1909.             If $iMonthNum = 12 Then
  1910.                 $iNextYear = $iYear + 1
  1911.             Else
  1912.                 $iNextYear = $iYear
  1913.             EndIf
  1914.  
  1915.             $iNextYear = StringFormat("%04d", $iNextYear)
  1916.             Return $iNextYear
  1917.     EndSelect
  1918. EndFunc   ;==>_DateNextMonthYear
  1919.  
  1920. ;===============================================================================
  1921. ;
  1922. ; Description:      Split Date and Time into two separateArrays.
  1923. ; Parameter(s):     $sDate format "yyyy/mm/dd[ hh:mm[:ss]]"
  1924. ;                    or    format "yyyy/mm/dd[Thh:mm[:ss]]"
  1925. ;                    or    format "yyyy-mm-dd[ hh:mm[:ss]]"
  1926. ;                    or    format "yyyy-mm-dd[Thh:mm[:ss]]"
  1927. ;                    or    format "yyyy.mm.dd[ hh:mm[:ss]]"
  1928. ;                    or    format "yyyy.mm.dd[Thh:mm[:ss]]"
  1929. ;                   $asDatePart[4] array that contains the Date
  1930. ;                   $iTimePart[4] array that contains the Time
  1931. ; Requirement(s):   None
  1932. ; Return Value(s):  Always 1
  1933. ; Author(s):        Jos van der Zande
  1934. ; Note(s):          Its expected you first do a _DateIsValid( $sDate ) for the input
  1935. ;
  1936. ;===============================================================================
  1937. Func _DateTimeSplit($sDate, ByRef $asDatePart, ByRef $iTimePart)
  1938.     Local $sDateTime
  1939.     Local $x
  1940.     ; split the Date and Time portion
  1941.     $sDateTime = StringSplit($sDate, " T")
  1942.     ; split the date portion
  1943.     If $sDateTime[0] > 0 Then $asDatePart = StringSplit($sDateTime[1], "/-.")
  1944.     ; split the Time portion
  1945.     If $sDateTime[0] > 1 Then
  1946.         $iTimePart = StringSplit($sDateTime[2], ":")
  1947.         If UBound($iTimePart) < 4 Then ReDim $iTimePart[4]
  1948.     Else
  1949.         Dim $iTimePart[4]
  1950.     EndIf
  1951.     ; Ensure the arrays contain 4 values
  1952.     If UBound($asDatePart) < 4 Then ReDim $asDatePart[4]
  1953.     ; update the array to contain numbers not strings
  1954.     For $x = 1 To 3
  1955.         If StringIsInt($asDatePart[$x]) Then
  1956.             $asDatePart[$x] = Number($asDatePart[$x])
  1957.         Else
  1958.             $asDatePart[$x] = -1
  1959.         EndIf
  1960.         If StringIsInt($iTimePart[$x]) Then
  1961.             $iTimePart[$x] = Number($iTimePart[$x])
  1962.         Else
  1963.             $iTimePart[$x] = -1
  1964.         EndIf
  1965.     Next
  1966.     Return (1)
  1967. EndFunc   ;==>_DateTimeSplit
  1968.  
  1969. ;===============================================================================
  1970. ;
  1971. ; Description:      Returns the number of days since noon 4713 BC January 1.
  1972. ; Parameter(s):     $Year  - Year in format YYYY
  1973. ;                   $Month - Month in format MM
  1974. ;                   $sDate - Day of the month format DD
  1975. ; Requirement(s):   None
  1976. ; Return Value(s):  On Success - Returns the Juliandate
  1977. ;                   On Failure - 0  and sets @ERROR = 1
  1978. ; Author(s):        Jos van der Zande / Jeremy Landes
  1979. ; Note(s):          None
  1980. ;
  1981. ;===============================================================================
  1982. Func _DateToDayValue($iYear, $iMonth, $iDay)
  1983.     Local $i_aFactor
  1984.     Local $i_bFactor
  1985.     Local $i_cFactor
  1986.     Local $i_eFactor
  1987.     Local $i_fFactor
  1988.     Local $iJulianDate
  1989.     ; Verify If InputDate is valid
  1990.     If Not _DateIsValid(StringFormat("%04d/%02d/%02d", $iYear, $iMonth, $iDay)) Then
  1991.         SetError(1)
  1992.         Return ("")
  1993.     EndIf
  1994.     If $iMonth < 3 Then
  1995.         $iMonth = $iMonth + 12
  1996.         $iYear = $iYear - 1
  1997.     EndIf
  1998.     $i_aFactor = Int($iYear / 100)
  1999.     $i_bFactor = Int($i_aFactor / 4)
  2000.     $i_cFactor = 2 - $i_aFactor + $i_bFactor
  2001.     $i_eFactor = Int(1461 * ($iYear + 4716) / 4)
  2002.     $i_fFactor = Int(153 * ($iMonth + 1) / 5)
  2003.     $iJulianDate = $i_cFactor + $iDay + $i_eFactor + $i_fFactor - 1524.5
  2004.     Return ($iJulianDate)
  2005. EndFunc   ;==>_DateToDayValue
  2006.  
  2007. ;===============================================================================
  2008. ;
  2009. ; Description:      Returns the DayofWeek number for a given Date.  1=Sunday
  2010. ; Parameter(s):     $Year
  2011. ;                   $Month
  2012. ;                   $day
  2013. ; Requirement(s):   None
  2014. ; Return Value(s):  On Success - Returns Day of the Week Range is 1 to 7 where 1=Sunday.
  2015. ;                   On Failure - 0 and sets @ERROR = 1
  2016. ; Author(s):        Jos van der Zande <jdeb at autoitscript dot com>
  2017. ; Note(s):          None
  2018. ;
  2019. ;===============================================================================
  2020. Func _DateToDayOfWeek($iYear, $iMonth, $iDay)
  2021.     Local $i_aFactor
  2022.     Local $i_yFactor
  2023.     Local $i_mFactor
  2024.     Local $i_dFactor
  2025.     ; Verify If InputDate is valid
  2026.     If Not _DateIsValid($iYear & "/" & $iMonth & "/" & $iDay) Then
  2027.         SetError(1)
  2028.         Return ("")
  2029.     EndIf
  2030.     $i_aFactor = Int((14 - $iMonth) / 12)
  2031.     $i_yFactor = $iYear - $i_aFactor
  2032.     $i_mFactor = $iMonth + (12 * $i_aFactor) - 2
  2033.     $i_dFactor = Mod($iDay + $i_yFactor + Int($i_yFactor / 4) - Int($i_yFactor / 100) + Int($i_yFactor / 400) + Int((31 * $i_mFactor) / 12), 7)
  2034.     Return ($i_dFactor + 1)
  2035. EndFunc   ;==>_DateToDayOfWeek
  2036.  
  2037. ;===============================================================================
  2038. ;
  2039. ; Description:      Returns the DayofWeek number for a given Date.  0=Monday 6=Sunday
  2040. ; Parameter(s):     $Year
  2041. ;                   $Month
  2042. ;                   $day
  2043. ; Requirement(s):   None
  2044. ; Return Value(s):  On Success - Returns Day of the Week Range is 0 to 6 where 0=Monday.
  2045. ;                   On Failure - 0 and sets @ERROR = 1
  2046. ; Author(s):        Jos van der Zande <jdeb at autoitscript dot com>
  2047. ; Note(s):          None
  2048. ;
  2049. ;===============================================================================
  2050. Func _DateToDayOfWeekISO($iYear, $iMonth, $iDay)
  2051.     Local $idow = _DateToDayOfWeek($iYear, $iMonth, $iDay)
  2052.     If @error Then
  2053.         SetError(1)
  2054.         Return ""
  2055.     EndIf
  2056.     If $idow >= 2 Then Return $idow - 2
  2057.     Return 6
  2058. EndFunc   ;==>_DateToDayOfWeekISO
  2059.  
  2060. ;===============================================================================
  2061. ;
  2062. ; Description:      Add the given days since noon 4713 BC January 1 and return the date.
  2063. ; Parameter(s):     $iJulianDate    - Julian date number
  2064. ;                   $Year  - Year in format YYYY
  2065. ;                   $Month - Month in format MM
  2066. ;                   $sDate - Day of the month format DD
  2067. ; Requirement(s):   None
  2068. ; Return Value(s):  On Success - Returns the Date in the parameter vars
  2069. ;                   On Failure - 0  and sets @ERROR = 1
  2070. ; Author(s):        Jos van der Zande
  2071. ; Note(s):          None
  2072. ;
  2073. ;===============================================================================
  2074. Func _DayValueToDate($iJulianDate, ByRef $iYear, ByRef $iMonth, ByRef $iDay)
  2075.     Local $i_zFactor
  2076.     Local $i_wFactor
  2077.     Local $i_aFactor
  2078.     Local $i_bFactor
  2079.     Local $i_xFactor
  2080.     Local $i_cFactor
  2081.     Local $i_dFactor
  2082.     Local $i_eFactor
  2083.     Local $i_fFactor
  2084.     ; check for valid input date
  2085.     If $iJulianDate < 0 Or Not IsNumber($iJulianDate) Then
  2086.         SetError(1)
  2087.         Return 0
  2088.     EndIf
  2089.     ; calculte the date
  2090.     $i_zFactor = Int($iJulianDate + 0.5)
  2091.     $i_wFactor = Int(($i_zFactor - 1867216.25) / 36524.25)
  2092.     $i_xFactor = Int($i_wFactor / 4)
  2093.     $i_aFactor = $i_zFactor + 1 + $i_wFactor - $i_xFactor
  2094.     $i_bFactor = $i_aFactor + 1524
  2095.     $i_cFactor = Int(($i_bFactor - 122.1) / 365.25)
  2096.     $i_dFactor = Int(365.25 * $i_cFactor)
  2097.     $i_eFactor = Int(($i_bFactor - $i_dFactor) / 30.6001)
  2098.     $i_fFactor = Int(30.6001 * $i_eFactor)
  2099.     $iDay = $i_bFactor - $i_dFactor - $i_fFactor
  2100.     ; (must get number less than or equal to 12)
  2101.     If $i_eFactor - 1 < 13 Then
  2102.         $iMonth = $i_eFactor - 1
  2103.     Else
  2104.         $iMonth = $i_eFactor - 13
  2105.     EndIf
  2106.     If $iMonth < 3 Then
  2107.         $iYear = $i_cFactor - 4715    ; (if Month is January or February)
  2108.     Else
  2109.         $iYear = $i_cFactor - 4716    ;(otherwise)
  2110.     EndIf
  2111.     $iYear = StringFormat("%04d", $iYear)
  2112.     $iMonth = StringFormat("%02d", $iMonth)
  2113.     $iDay = StringFormat("%02d", $iDay)
  2114.     Return $iYear & "/" & $iMonth & "/" & $iDay
  2115. EndFunc   ;==>_DayValueToDate
  2116.  
  2117. ;===============================================================================
  2118. ;
  2119. ; Description:      Returns the date in the PC's regional settings format.
  2120. ; Parameter(s):     $date - format "YYYY/MM/DD"
  2121. ;                   $sType - :
  2122. ;                      0 - Display a date and/or time. If there is a date part, display it as a short date.
  2123. ;                          If there is a time part, display it as a long time. If present, both parts are displayed.
  2124. ;                      1 - Display a date using the long date format specified in your computer's regional settings.
  2125. ;                      2 - Display a date using the short date format specified in your computer's regional settings.
  2126. ;                      3 - Display a time using the time format specified in your computer's regional settings.
  2127. ;                      4 - Display a time using the 24-hour format (hh:mm).
  2128. ; Requirement(s):   None
  2129. ; Return Value(s):  On Success - Returns date in proper format
  2130. ;                   On Failure - 0  and Set
  2131. ;                                   @ERROR to:  1 - Invalid $sDate
  2132. ;                                               2 - Invalid $sType
  2133. ; Author(s):        Jos van der Zande <jdeb at autoitscript dot com>
  2134. ; Note(s):          None...
  2135. ;
  2136. ;===============================================================================
  2137. Func _DateTimeFormat($sDate, $sType)
  2138.     Local $asDatePart[4]
  2139.     Local $asTimePart[4]
  2140.     Local $sTempDate = ""
  2141.     Local $sTempTime = ""
  2142.     Local $sAM
  2143.     Local $sPM
  2144.     Local $iWday
  2145.     Local $lngX
  2146.     ; Verify If InputDate is valid
  2147.     If Not _DateIsValid($sDate) Then
  2148.         SetError(1)
  2149.         Return ("")
  2150.     EndIf
  2151.     ; input validation
  2152.     If $sType < 0 Or $sType > 5 Or Not IsInt($sType) Then
  2153.         SetError(2)
  2154.         Return ("")
  2155.     EndIf
  2156.     ; split the date and time into arrays
  2157.     _DateTimeSplit($sDate, $asDatePart, $asTimePart)
  2158.     ;
  2159.     ;   Const $LOCALE_USER_DEFAULT = 0x400
  2160.     ;   Const $LOCALE_SDATE = 0x1D            ;  date separator
  2161.     ;   Const $LOCALE_STIME = 0x1E            ;  time separator
  2162.     ;   Const $LOCALE_S1159 = 0x28            ;  AM designator
  2163.     ;   Const $LOCALE_S2359 = 0x29            ;  PM designator
  2164.     ;   Const $LOCALE_SSHORTDATE = 0x1F       ;  short date format string
  2165.     ;   Const $LOCALE_SLONGDATE = 0x20        ;  long date format string
  2166.     ;   Const $LOCALE_STIMEFORMAT = 0x1003    ;  time format string
  2167.  
  2168.     Switch $sType
  2169.         Case 0
  2170.             ; Get ShortDate format
  2171.             $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1F, "str", "", "long", 255)
  2172.             If Not @error And $lngX[0] <> 0 Then
  2173.                 $sTempDate = $lngX[3]
  2174.             Else
  2175.                 $sTempDate = "M/d/yyyy"
  2176.             EndIf
  2177.             ;
  2178.             ; Get Time format
  2179.             If $asTimePart[0] > 1 Then
  2180.                 $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1003, "str", "", "long", 255)
  2181.                 If Not @error And $lngX[0] <> 0 Then
  2182.                     $sTempTime = $lngX[3]
  2183.                 Else
  2184.                     $sTempTime = "h:mm:ss tt"
  2185.                 EndIf
  2186.             EndIf
  2187.         Case 1
  2188.             ; Get LongDate format
  2189.             $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x20, "str", "", "long", 255)
  2190.             If Not @error And $lngX[0] <> 0 Then
  2191.                 $sTempDate = $lngX[3]
  2192.             Else
  2193.                 $sTempDate = "dddd, MMMM dd, yyyy"
  2194.             EndIf
  2195.         Case 2
  2196.             ; Get ShortDate format
  2197.             $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1F, "str", "", "long", 255)
  2198.             If Not @error And $lngX[0] <> 0 Then
  2199.                 $sTempDate = $lngX[3]
  2200.             Else
  2201.                 $sTempDate = "M/d/yyyy"
  2202.             EndIf
  2203.         Case 3
  2204.             ;
  2205.             ; Get Time format
  2206.             If $asTimePart[0] > 1 Then
  2207.                 $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1003, "str", "", "long", 255)
  2208.                 If Not @error And $lngX[0] <> 0 Then
  2209.                     $sTempTime = $lngX[3]
  2210.                 Else
  2211.                     $sTempTime = "h:mm:ss tt"
  2212.                 EndIf
  2213.             EndIf
  2214.         Case 4
  2215.             If $asTimePart[0] > 1 Then
  2216.                 $sTempTime = "hh:mm"
  2217.             EndIf
  2218.         Case 5
  2219.             If $asTimePart[0] > 1 Then
  2220.                 $sTempTime = "hh:mm:ss"
  2221.             EndIf
  2222.     EndSwitch
  2223.     ; Format DATE
  2224.     If $sTempDate <> "" Then
  2225.         ;   Const $LOCALE_SDATE = 0x1D            ;  date separator
  2226.         $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1D, "str", "", "long", 255)
  2227.         If Not @error And $lngX[0] <> 0 Then
  2228.             $sTempTime = StringReplace($sTempTime, "/", $lngX[3])
  2229.         EndIf
  2230.         $iWday = _DateToDayOfWeek($asDatePart[1], $asDatePart[2], $asDatePart[3])
  2231.         $asDatePart[3] = StringRight("0" & $asDatePart[3], 2) ; make sure the length is 2
  2232.         $asDatePart[2] = StringRight("0" & $asDatePart[2], 2) ; make sure the length is 2
  2233.         $sTempDate = StringReplace($sTempDate, "d", "@")
  2234.         $sTempDate = StringReplace($sTempDate, "m", "#")
  2235.         $sTempDate = StringReplace($sTempDate, "y", "&")
  2236.         $sTempDate = StringReplace($sTempDate, "@@@@", _DateDayOfWeek($iWday, 0))
  2237.         $sTempDate = StringReplace($sTempDate, "@@@", _DateDayOfWeek($iWday, 1))
  2238.         $sTempDate = StringReplace($sTempDate, "@@", $asDatePart[3])
  2239.         $sTempDate = StringReplace($sTempDate, "@", StringReplace(StringLeft($asDatePart[3], 1), "0", "") & StringRight($asDatePart[3], 1))
  2240.         $sTempDate = StringReplace($sTempDate, "####", _DateMonthOfYear($asDatePart[2], 0))
  2241.         $sTempDate = StringReplace($sTempDate, "###", _DateMonthOfYear($asDatePart[2], 1))
  2242.         $sTempDate = StringReplace($sTempDate, "##", $asDatePart[2])
  2243.         $sTempDate = StringReplace($sTempDate, "#", StringReplace(StringLeft($asDatePart[2], 1), "0", "") & StringRight($asDatePart[2], 1))
  2244.         $sTempDate = StringReplace($sTempDate, "&&&&", $asDatePart[1])
  2245.         $sTempDate = StringReplace($sTempDate, "&&", StringRight($asDatePart[1], 2))
  2246.     EndIf
  2247.     ; Format TIME
  2248.     If $sTempTime <> "" Then
  2249.         $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x28, "str", "", "long", 255)
  2250.         If Not @error And $lngX[0] <> 0 Then
  2251.             $sAM = $lngX[3]
  2252.         Else
  2253.             $sAM = "AM"
  2254.         EndIf
  2255.         $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x29, "str", "", "long", 255)
  2256.         If Not @error And $lngX[0] <> 0 Then
  2257.             $sPM = $lngX[3]
  2258.         Else
  2259.             $sPM = "PM"
  2260.         EndIf
  2261.         ;   Const $LOCALE_STIME = 0x1E            ;  time separator
  2262.         $lngX = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", 0x400, "long", 0x1E, "str", "", "long", 255)
  2263.         If Not @error And $lngX[0] <> 0 Then
  2264.             $sTempTime = StringReplace($sTempTime, ":", $lngX[3])
  2265.         EndIf
  2266.         If StringInStr($sTempTime, "tt") Then
  2267.             If $asTimePart[1] < 12 Then
  2268.                 $sTempTime = StringReplace($sTempTime, "tt", $sAM)
  2269.                 If $asTimePart[1] = 0 Then $asTimePart[1] = 12
  2270.             Else
  2271.                 $sTempTime = StringReplace($sTempTime, "tt", $sPM)
  2272.                 If $asTimePart[1] > 12 Then $asTimePart[1] = $asTimePart[1] - 12
  2273.             EndIf
  2274.         EndIf
  2275.         $asTimePart[1] = StringRight("0" & $asTimePart[1], 2) ; make sure the length is 2
  2276.         $asTimePart[2] = StringRight("0" & $asTimePart[2], 2) ; make sure the length is 2
  2277.         $asTimePart[3] = StringRight("0" & $asTimePart[3], 2) ; make sure the length is 2
  2278.         $sTempTime = StringReplace($sTempTime, "hh", StringFormat("%02d", $asTimePart[1]))
  2279.         $sTempTime = StringReplace($sTempTime, "h", StringReplace(StringLeft($asTimePart[1], 1), "0", "") & StringRight($asTimePart[1], 1))
  2280.         $sTempTime = StringReplace($sTempTime, "mm", StringFormat("%02d", $asTimePart[2]))
  2281.         $sTempTime = StringReplace($sTempTime, "ss", StringFormat("%02d", $asTimePart[3]))
  2282.         $sTempDate = StringStripWS($sTempDate & " " & $sTempTime, 3)
  2283.     EndIf
  2284.     Return ($sTempDate)
  2285. EndFunc   ;==>_DateTimeFormat
  2286.  
  2287. ;===============================================================================
  2288. ;
  2289. ; Description:      Returns the the julian date in format YYDDD
  2290. ; Parameter(s):     $iJulianDate    - Julian date number
  2291. ;                   $Year  - Year in format YYYY
  2292. ;                   $Month - Month in format MM
  2293. ;                   $sDate - Day of the month format DD
  2294. ; Requirement(s):   None
  2295. ; Return Value(s):  On Success - Returns the Date in the parameter vars
  2296. ;                   On Failure - 0  and sets @ERROR = 1
  2297. ; Author(s):        Jeremy Landes / Jos van der Zande
  2298. ; Note(s):          None
  2299. ;
  2300. ;===============================================================================
  2301. Func _DateJulianDayNo($iYear, $iMonth, $iDay)
  2302.     Local $sFullDate
  2303.     Local $aiDaysInMonth
  2304.     Local $iJDay
  2305.     Local $iCntr
  2306.     ; Verify If InputDate is valid
  2307.     $sFullDate = StringFormat("%04d/%02d/%02d", $iYear, $iMonth, $iDay)
  2308.     If Not _DateIsValid($sFullDate) Then
  2309.         SetError(1)
  2310.         Return ""
  2311.     EndIf
  2312.     ; Build JDay value
  2313.     $iJDay = 0
  2314.     $aiDaysInMonth = __DaysInMonth($iYear)
  2315.     For $iCntr = 1 To $iMonth - 1
  2316.         $iJDay = $iJDay + $aiDaysInMonth[$iCntr]
  2317.     Next
  2318.     $iJDay = ($iYear * 1000) + ($iJDay + $iDay)
  2319.     Return $iJDay
  2320. EndFunc   ;==>_DateJulianDayNo
  2321.  
  2322. ;===============================================================================
  2323. ;
  2324. ; Description:      Returns the date for a julian date in format YYDDD
  2325. ; Parameter(s):     $iJDate  - Julian date number
  2326. ; Requirement(s):   None
  2327. ; Return Value(s):  On Success - Returns the Date in format YYYY/MM/DD
  2328. ;                   On Failure - 0  and sets @ERROR = 1
  2329. ; Author(s):        Jeremy Landes / Jos van der Zande
  2330. ; Note(s):          None
  2331. ;
  2332. ;===============================================================================
  2333. Func _JulianToDate($iJDay)
  2334.     Local $aiDaysInMonth
  2335.     Local $iYear
  2336.     Local $iMonth
  2337.     Local $iDay
  2338.     Local $iDays
  2339.     Local $iMaxDays
  2340.     Local $sSep = "/"
  2341.     ; Verify If InputDate is valid
  2342.     $iYear = Int($iJDay / 1000)
  2343.     $iDays = Mod($iJDay, 1000)
  2344.     $iMaxDays = 365
  2345.     If _DateIsLeapYear($iYear) Then $iMaxDays = 366
  2346.     If $iDays > $iMaxDays Then
  2347.         SetError(1)
  2348.         Return ""
  2349.     EndIf
  2350.     ; Convert to regular date
  2351.     $aiDaysInMonth = __DaysInMonth($iYear)
  2352.     $iMonth = 1
  2353.     While $iDays > $aiDaysInMonth[ $iMonth ]
  2354.         $iDays = $iDays - $aiDaysInMonth[ $iMonth ]
  2355.         $iMonth = $iMonth + 1
  2356.     WEnd
  2357.     $iDay = $iDays
  2358.     Return StringFormat("%04d%s%02d%s%02d", $iYear, $sSep, $iMonth, $sSep, $iDay)
  2359. EndFunc   ;==>_JulianToDate
  2360.  
  2361. ;===============================================================================
  2362. ;
  2363. ; Description:      Returns the current Date and Time in the pc's format
  2364. ; Parameter(s):     None
  2365. ; Requirement(s):   None
  2366. ; Return Value(s):  On Success - Date in pc's format
  2367. ; Author(s):        Jos van der Zande
  2368. ; Note(s):          None
  2369. ;
  2370. ;===============================================================================
  2371. Func _Now()
  2372.     Return (_DateTimeFormat(@YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, 0))
  2373. EndFunc   ;==>_Now
  2374.  
  2375. ;===============================================================================
  2376. ;
  2377. ; Description:      Returns the current Date and Time in format YYYY/MM/DD HH:MM:SS
  2378. ; Parameter(s):     None
  2379. ; Requirement(s):   None
  2380. ; Return Value(s):  On Success - Date in in format YYYY/MM/DD HH:MM:SS
  2381. ; Author(s):        Jos van der Zande
  2382. ; Note(s):          None
  2383. ;
  2384. ;===============================================================================
  2385. Func _NowCalc()
  2386.     Return (@YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC)
  2387. EndFunc   ;==>_NowCalc
  2388. ;===============================================================================
  2389. ;
  2390. ; Description:      Returns the current Date in format YYYY/MM/DD
  2391. ; Parameter(s):     None
  2392. ; Requirement(s):   None
  2393. ; Return Value(s):  On Success - Date in in format YYYY/MM/DD
  2394. ; Author(s):        Jos van der Zande
  2395. ; Note(s):          None
  2396. ;
  2397. ;===============================================================================
  2398. Func _NowCalcDate()
  2399.     Return (@YEAR & "/" & @MON & "/" & @MDAY)
  2400. EndFunc   ;==>_NowCalcDate
  2401.  
  2402. ;===============================================================================
  2403. ;
  2404. ; Description:      Returns the current Date in the pc's format
  2405. ; Parameter(s):     None
  2406. ; Requirement(s):   None
  2407. ; Return Value(s):  On Success - Date in pc's format
  2408. ; Author(s):        Jos van der Zande (Larry's idea)
  2409. ; Note(s):          None
  2410. ;
  2411. ;===============================================================================
  2412. Func _NowDate()
  2413.     Return (_DateTimeFormat(@YEAR & "/" & @MON & "/" & @MDAY, 0))
  2414. EndFunc   ;==>_NowDate
  2415.  
  2416. ;===============================================================================
  2417. ;
  2418. ; Description:      Returns the current Date and Time in the pc's format
  2419. ; Parameter(s):     None
  2420. ; Requirement(s):   None
  2421. ; Return Value(s):  On Success - Date in pc's format
  2422. ; Author(s):        Jos van der Zande
  2423. ; Note(s):          None
  2424. ;
  2425. ;===============================================================================
  2426. Func _NowTime($sType = 3)
  2427.     If $sType < 3 Or $sType > 5 Then $sType = 3
  2428.     Return (_DateTimeFormat(@YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, $sType))
  2429. EndFunc   ;==>_NowTime
  2430.  
  2431. ;===============================================================================
  2432. ;
  2433. ; Description:      Sets the local date of the system / computer
  2434. ; Parameter(s):     $iDay   - Day of month Values: 1-31
  2435. ;                   $iMonth - Moth Values: 1-12
  2436. ;                   $iYear (optional)  - Year Values: > 0 (windows might restrict this further!!)
  2437. ;
  2438. ; Requirement(s):   DllCall
  2439. ; Return Value(s):  On Success - 1
  2440. ;                   On Failure - 0 sets @ERROR = 1 and @EXTENDED (Windows API error code)
  2441. ;
  2442. ; Error code(s):    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp
  2443. ;
  2444. ; Author(s):        /dev/null
  2445. ; Note(s):          -
  2446. ;
  2447. ;===============================================================================
  2448. Func _SetDate($iDay, $iMonth = 0, $iYear = 0)
  2449.  
  2450.     Local $iRetval, $SYSTEMTIME, $lpSystemTime
  2451.  
  2452.     ;============================================================================
  2453.     ;== Some error checking
  2454.     ;============================================================================
  2455.     If $iYear = 0 Then $iYear = @YEAR
  2456.     If $iMonth = 0 Then $iMonth = @MON
  2457.     If Not _DateIsValid($iYear & "/" & $iMonth & "/" & $iDay) Then Return 1
  2458.  
  2459.     $SYSTEMTIME = DllStructCreate("ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort")
  2460.     $lpSystemTime = DllStructGetPtr($SYSTEMTIME)
  2461.  
  2462.     ;============================================================================
  2463.     ;== Get the local system time to fill up the SYSTEMTIME structure
  2464.     ;============================================================================
  2465.     $iRetval = DllCall("kernel32.dll", "long", "GetLocalTime", "ptr", $lpSystemTime)
  2466.  
  2467.     ;============================================================================
  2468.     ;== Change the necessary values
  2469.     ;============================================================================
  2470.     DllStructSetData($SYSTEMTIME, 4, $iDay)
  2471.     If $iMonth > 0 Then DllStructSetData($SYSTEMTIME, 2, $iMonth)
  2472.     If $iYear > 0 Then DllStructSetData($SYSTEMTIME, 1, $iYear)
  2473.  
  2474.     ;============================================================================
  2475.     ;== Set the new date
  2476.     ;============================================================================
  2477.     $iRetval = DllCall("kernel32.dll", "long", "SetLocalTime", "ptr", $lpSystemTime)
  2478.  
  2479.     ;============================================================================
  2480.     ;== If DllCall was successfull, check for an error of the API Call
  2481.     ;============================================================================
  2482.     If @error = 0 Then
  2483.         If $iRetval[0] = 0 Then
  2484.             Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
  2485.             SetExtended($lastError[0])
  2486.             SetError(1)
  2487.             Return 0
  2488.         Else
  2489.             Return 1
  2490.         EndIf
  2491.         ;============================================================================
  2492.         ;== If DllCall was UNsuccessfull, return an error
  2493.         ;============================================================================
  2494.     Else
  2495.         SetError(1)
  2496.         Return 0
  2497.     EndIf
  2498.  
  2499. EndFunc   ;==>_SetDate
  2500.  
  2501. ;===============================================================================
  2502. ;
  2503. ; Description:      Sets the local time of the system / computer
  2504. ; Parameter(s):     $iHour  - hour Values: 0-23
  2505. ;                   $iMinute - minute Values: 0-59
  2506. ;                   $iSecond (optional)  - second Values: 0-59
  2507. ;
  2508. ; Requirement(s):   DllCall
  2509. ; Return Value(s):  On Success - 1
  2510. ;                   On Failure - 0 sets @ERROR = 1 and @EXTENDED (Windows API error code)
  2511. ;
  2512. ; Error code(s):    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp
  2513. ;
  2514. ; Author(s):        /dev/null
  2515. ; Note(s):          -
  2516. ;
  2517. ;===============================================================================
  2518. Func _SetTime($iHour, $iMinute, $iSecond = 0)
  2519.  
  2520.     Local $iRetval, $SYSTEMTIME, $lpSystemTime
  2521.  
  2522.     ;============================================================================
  2523.     ;== Some error checking
  2524.     ;============================================================================
  2525.     If $iHour < 0 Or $iHour > 23 Then Return 1
  2526.     If $iMinute < 0 Or $iMinute > 59 Then Return 1
  2527.     If $iSecond < 0 Or $iSecond > 59 Then Return 1
  2528.  
  2529.     $SYSTEMTIME = DllStructCreate("ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort")
  2530.     $lpSystemTime = DllStructGetPtr($SYSTEMTIME)
  2531.  
  2532.     ;============================================================================
  2533.     ;== Get the local system time to fill up the SYSTEMTIME structure
  2534.     ;============================================================================
  2535.     $iRetval = DllCall("kernel32.dll", "long", "GetLocalTime", "ptr", $lpSystemTime)
  2536.  
  2537.     ;============================================================================
  2538.     ;== Change the necessary values
  2539.     ;============================================================================
  2540.     DllStructSetData($SYSTEMTIME, 5, $iHour)
  2541.     DllStructSetData($SYSTEMTIME, 6, $iMinute)
  2542.     If $iSecond > 0 Then DllStructSetData($SYSTEMTIME, 7, $iSecond)
  2543.  
  2544.     ;============================================================================
  2545.     ;== Set the new time
  2546.     ;============================================================================
  2547.     $iRetval = DllCall("kernel32.dll", "long", "SetLocalTime", "ptr", $lpSystemTime)
  2548.  
  2549.     ;============================================================================
  2550.     ;== If DllCall was successfull, check for an error of the API Call
  2551.     ;============================================================================
  2552.     If @error = 0 Then
  2553.         If $iRetval[0] = 0 Then
  2554.             Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
  2555.             SetExtended($lastError[0])
  2556.             SetError(1)
  2557.             Return 0
  2558.         Else
  2559.             Return 1
  2560.         EndIf
  2561.         ;============================================================================
  2562.         ;== If DllCall was UNsuccessfull, return an error
  2563.         ;============================================================================
  2564.     Else
  2565.         SetError(1)
  2566.         Return 0
  2567.     EndIf
  2568.  
  2569. EndFunc   ;==>_SetTime
  2570.  
  2571. ;===============================================================================
  2572. ;
  2573. ; Description:      Converts the specified tick amount to hours, minutes, and
  2574. ;                   seconds.
  2575. ; Parameter(s):     $iTicks - Tick amount
  2576. ;                   $iHours - Variable to store the hours (ByRef)
  2577. ;                   $iMins  - Variable to store the minutes (ByRef)
  2578. ;                   $iSecs  - Variable to store the seconds (ByRef)
  2579. ; Requirement(s):   None
  2580. ; Return Value(s):  On Success - 1
  2581. ;                   On Failure - 0 and sets @ERROR = 1
  2582. ; Author(s):        Marc <mrd at gmx de>
  2583. ; Note(s):          None
  2584. ;
  2585. ;===============================================================================
  2586. Func _TicksToTime($iTicks, ByRef $iHours, ByRef $iMins, ByRef $iSecs)
  2587.     If Number($iTicks) > 0 Then
  2588.         $iTicks = Round($iTicks / 1000)
  2589.         $iHours = Int($iTicks / 3600)
  2590.         $iTicks = Mod($iTicks, 3600)
  2591.         $iMins = Int($iTicks / 60)
  2592.         $iSecs = Round(Mod($iTicks, 60))
  2593.         ; If $iHours = 0 then $iHours = 24
  2594.         Return 1
  2595.     ElseIf Number($iTicks) = 0 Then
  2596.         $iHours = 0
  2597.         $iTicks = 0
  2598.         $iMins = 0
  2599.         $iSecs = 0
  2600.         Return 1
  2601.     Else
  2602.         SetError(1)
  2603.         Return 0
  2604.     EndIf
  2605. EndFunc   ;==>_TicksToTime
  2606.  
  2607. ;===============================================================================
  2608. ;
  2609. ; Description:      Converts the specified hours, minutes, and seconds to ticks.
  2610. ; Parameter(s):     $iHours - Hours
  2611. ;                   $iMins  - Minutes
  2612. ;                   $iSecs  - Seconds
  2613. ; Requirement(s):   None
  2614. ; Return Value(s):  On Success - Converted tick amount
  2615. ;                   On Failure - 0 and sets @ERROR = 1
  2616. ; Author(s):        Marc <mrd at gmx de>
  2617. ;                   SlimShady: added the default time and made parameters optional
  2618. ; Note(s):          None
  2619. ;
  2620. ;===============================================================================
  2621. Func _TimeToTicks($iHours = @HOUR, $iMins = @MIN, $iSecs = @SEC)
  2622.     ;==============================================
  2623.     ; Local Constant/Variable Declaration Section
  2624.     ;==============================================
  2625.     Local $iTicks
  2626.  
  2627.     If StringIsInt($iHours) And StringIsInt($iMins) And StringIsInt($iSecs) Then
  2628.         $iTicks = 1000 * ((3600 * $iHours) + (60 * $iMins) + $iSecs)
  2629.         Return $iTicks
  2630.     Else
  2631.         SetError(1)
  2632.         Return 0
  2633.     EndIf
  2634. EndFunc   ;==>_TimeToTicks
  2635.  
  2636. ;===============================================================================
  2637. ;
  2638. ; Function Name:    _WeekNumberISO()
  2639. ; Description:      Find out the week number of current date OR date given in parameters
  2640. ;
  2641. ; Parameter(s):     $iDay    - Day value (default = current day)
  2642. ;                   $iMonth    - Month value (default = current month)
  2643. ;                   $iYear    - Year value (default = current year)
  2644. ; Requirement(s):
  2645. ; Return Value(s):  On Success     - Returns week number of given date
  2646. ;                   On Failure     - returns -1  and sets @ERROR = 1 on faulty parameters values
  2647. ;                   On non-acceptable weekstart value sets @ERROR = 99 and uses default (Sunday) as starting day
  2648. ; Author(s):        Tuape
  2649. ;                   JdeB: modified to UDF standards & Doc.
  2650. ;                   JdeB: Change calculation logic.
  2651. ;===============================================================================
  2652. ;
  2653. Func _WeekNumberISO($iYear = @YEAR, $iMonth = @MON, $iDay = @MDAY)
  2654.     Local $idow, $iDow0101
  2655.  
  2656.     ; Check for erroneous input in $Day, $Month & $Year
  2657.     If $iDay > 31 Or $iDay < 1 Then
  2658.         SetError(1)
  2659.         Return -1
  2660.     ElseIf $iMonth > 12 Or $iMonth < 1 Then
  2661.         SetError(1)
  2662.         Return -1
  2663.     ElseIf $iYear < 1 Or $iYear > 2999 Then
  2664.         SetError(1)
  2665.         Return -1
  2666.     EndIf
  2667.  
  2668.     $idow = _DateToDayOfWeekISO($iYear, $iMonth, $iDay);
  2669.     $iDow0101 = _DateToDayOfWeekISO($iYear, 1, 1);
  2670.  
  2671.     If ($iMonth = 1 And 3 < $iDow0101 And $iDow0101 < 7 - ($iDay - 1)) Then
  2672.         ;days before week 1 of the current year have the same week number as
  2673.         ;the last day of the last week of the previous year
  2674.         $idow = $iDow0101 - 1;
  2675.         $iDow0101 = _DateToDayOfWeekISO($iYear - 1, 1, 1);
  2676.         $iMonth = 12
  2677.         $iDay = 31
  2678.         $iYear = $iYear - 1
  2679.     ElseIf ($iMonth = 12 And 30 - ($iDay - 1) < _DateToDayOfWeekISO($iYear + 1, 1, 1) And _DateToDayOfWeekISO($iYear + 1, 1, 1) < 4) Then
  2680.         ; days after the last week of the current year have the same week number as
  2681.         ; the first day of the next year, (i.e. 1)
  2682.         Return 1;
  2683.     EndIf
  2684.  
  2685.     Return Int((_DateToDayOfWeekISO($iYear, 1, 1) < 4) + 4 * ($iMonth - 1) + (2 * ($iMonth - 1) + ($iDay - 1) + $iDow0101 - $idow + 6) * 36 / 256)
  2686.  
  2687. EndFunc   ;==>_WeekNumberISO
  2688.  
  2689.  
  2690. ;===============================================================================
  2691. ;
  2692. ; Function Name:    _WeekNumber()
  2693. ; Description:      Find out the week number of current date OR date given in parameters
  2694. ;
  2695. ; Parameter(s):     $iDay    - Day value (default = current day)
  2696. ;                   $iMonth    - Month value (default = current month)
  2697. ;                   $iYear    - Year value (default = current year)
  2698. ;                   $iWeekstart - Week starts from Sunday (1, default) or Monday (2)
  2699. ; Requirement(s):
  2700. ; Return Value(s):  On Success     - Returns week number of given date
  2701. ;                   On Failure     - returns -1  and sets @ERROR = 1 on faulty parameters values
  2702. ;                   On non-acceptable weekstart value sets @ERROR = 99 and uses default (Sunday) as starting day
  2703. ; Author(s):        JdeB
  2704. ;===============================================================================
  2705. ;
  2706. Func _WeekNumber($iYear = @YEAR, $iMonth = @MON, $iDay = @MDAY, $iWeekStart = 1)
  2707.     Local $iDow0101, $iDow0101ny
  2708.     Local $iDate, $iStartWeek1, $iEndWeek1, $iEndWeek1Date, $iStartWeek1ny, $iStartWeek1Dateny
  2709.     Local $iCurrDateDiff, $iCurrDateDiffny
  2710.  
  2711.     ; Check for erroneous input in $Day, $Month & $Year
  2712.     If $iDay > 31 Or $iDay < 1 Then
  2713.         SetError(1)
  2714.         Return -1
  2715.     ElseIf $iMonth > 12 Or $iMonth < 1 Then
  2716.         SetError(1)
  2717.         Return -1
  2718.     ElseIf $iYear < 1 Or $iYear > 2999 Then
  2719.         SetError(1)
  2720.         Return -1
  2721.     ElseIf $iWeekStart < 1 Or $iWeekStart > 2 Then
  2722.         SetError(2)
  2723.         Return -1
  2724.     EndIf
  2725.     ;
  2726.     ;$idow = _DateToDayOfWeekISO($iYear, $iMonth, $iDay);
  2727.     $iDow0101 = _DateToDayOfWeekISO($iYear, 1, 1);
  2728.     $iDate = $iYear & '/' & $iMonth & '/' & $iDay
  2729.     ;Calculate the Start and End date of Week 1 this year
  2730.     If $iWeekStart = 1 Then
  2731.         If $iDow0101 = 6 Then
  2732.             $iStartWeek1 = 0
  2733.         Else
  2734.             $iStartWeek1 = -1 * $iDow0101 - 1
  2735.         EndIf
  2736.         $iEndWeek1 = $iStartWeek1 + 6
  2737.     Else
  2738.         $iStartWeek1 = $iDow0101 * - 1
  2739.         $iEndWeek1 = $iStartWeek1 + 6
  2740.     EndIf
  2741.     ;$iStartWeek1Date = _DateAdd('d',$iStartWeek1,$iYear & '/01/01')
  2742.     $iEndWeek1Date = _DateAdd('d', $iEndWeek1, $iYear & '/01/01')
  2743.     ;Calculate the Start and End date of Week 1 this Next year
  2744.     $iDow0101ny = _DateToDayOfWeekISO($iYear + 1, 1, 1);
  2745.     ;  1 = start on Sunday / 2 = start on Monday
  2746.     If $iWeekStart = 1 Then
  2747.         If $iDow0101ny = 6 Then
  2748.             $iStartWeek1ny = 0
  2749.         Else
  2750.             $iStartWeek1ny = -1 * $iDow0101ny - 1
  2751.         EndIf
  2752.         ;$IEndWeek1ny = $iStartWeek1ny + 6
  2753.     Else
  2754.         $iStartWeek1ny = $iDow0101ny * - 1
  2755.         ;$IEndWeek1ny = $iStartWeek1ny + 6
  2756.     EndIf
  2757.     $iStartWeek1Dateny = _DateAdd('d', $iStartWeek1ny, $iYear + 1 & '/01/01')
  2758.     ;$iEndWeek1Dateny = _DateAdd('d',$IEndWeek1ny,$iYear+1 & '/01/01')
  2759.     ;number of days after end week 1
  2760.     $iCurrDateDiff = _DateDiff('d', $iEndWeek1Date, $iDate) - 1
  2761.     ;number of days before next week 1 start
  2762.     $iCurrDateDiffny = _DateDiff('d', $iStartWeek1Dateny, $iDate)
  2763.     ;
  2764.     ; Check for end of year
  2765.     If $iCurrDateDiff >= 0 And $iCurrDateDiffny < 0 Then Return 2 + Int($iCurrDateDiff / 7)
  2766.     ; > week 1
  2767.     If $iCurrDateDiff < 0 Or $iCurrDateDiffny >= 0 Then Return 1
  2768. EndFunc   ;==>_WeekNumber
  2769.  
  2770.  
  2771. ;===============================================================================
  2772. ;
  2773. ; Description:      returns an Array that contains the numbers of days per month
  2774. ;                   te specified year
  2775. ; Parameter(s):     $iYear
  2776. ; Requirement(s):   None
  2777. ; Return Value(s):  On Success - Array that contains the numbers of days per month
  2778. ;                   On Failure - none
  2779. ; Author(s):        Jos van der Zande / Jeremy Landes
  2780. ; Note(s):          None
  2781. ;
  2782. ;===============================================================================
  2783. Func __DaysInMonth($iYear)
  2784.     Local $aiDays
  2785.     $aiDays = StringSplit("31,28,31,30,31,30,31,31,30,31,30,31", ",")
  2786.     If _DateIsLeapYear($iYear) Then $aiDays[2] = 29
  2787.     Return $aiDays
  2788. EndFunc   ;==>__DaysInMonth
  2789.  
  2790. ; ----------------------------------------------------------------------------
  2791. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\beta\Include\Date.au3>
  2792. ; ----------------------------------------------------------------------------
  2793.  
  2794.  
  2795. TrayTip("[ Tantra Bot System] " , "Author: booster101" & @CRLF, 8 , 16)
  2796.  
  2797. Opt ("SendKeyDelay", 50       )
  2798. Opt ("WinTitleMatchMode", 4  )
  2799. Opt ("SendKeyDownDelay", 50  )
  2800. Opt ("MouseClickDownDelay", 50)
  2801.  
  2802. HotKeySet ("!1", "GetPosUpperLeft")
  2803. HotKeySet ("!2", "GetPosLowerLeft")
  2804. HotKeySet ("!3", "GetPosUpperRight")
  2805. HotKeySet ("!4", "GetPosLowerRight")
  2806. HotkeySet("{F5}", "GetPos")
  2807. HotKeySet ("{F8}",  "Auto_5"     )
  2808. HotKeySet ("{F9}",  "TradeSpam" ) ; Spam Trade
  2809. HotkeySet ("{F10}", "Stop"       )
  2810. HotKeySet ("{F11}", "Left_Click2")
  2811. HotKeySet ("+!m", "MenuLaunch")  ;Shift-Alt-m
  2812. HotKeySet ("+!a", "AutoLoginMenu")  ;Shift-Alt-a
  2813. HotKeySet ("+!t", "MandaraTeleportHack")  ;Shift-Alt-a
  2814.  
  2815. $versionnumber = "1.05"
  2816. Global $defaultstatus = "Please visit http://www.bigbytes.net"
  2817. Global $status
  2818. Global $wintitle
  2819. Global $inputAddress
  2820. Global $statuslabel
  2821.  
  2822. $lootflag = 1 ;default loot On
  2823. $MonsterSelectTargetFlag = 1 ;default on
  2824. $count = 0
  2825. $count2 = 0
  2826. dim $b
  2827. dim $EXIT
  2828. $Value = "";
  2829.  
  2830.  
  2831. $Process = 'HTLauncher.exe' ;-> Target process
  2832. $PID = ProcessExists($Process) ;-> Get Process ID
  2833.  
  2834. $baseAddressCharacter = 0x109BE1D0 ;-> myCharacter baseaddress
  2835. $myMaxHPoffset = 268;-> myCharacterMaxHP offset H10C
  2836. $myCurHPoffset = 272;-> myCharacterCurHP offset H110
  2837. $myXaddrOffset = 9178;--> my cur X location offset &H23DA
  2838. $myYaddrOffset = 9182;--> my cur X location offset &H23DE
  2839. $TPMaxAddrOffset = 804 ;baseaddr + &H324 (Hex 324 = Dec 804)
  2840. $TPCurAddrOffset = 808;baseaddr + &H328
  2841. $baseAddressTargetMonster = 0x109BE280 ;-> Read/write address
  2842. $chatMsgAddrbase = 0x109BE200 ; -> chat message base address
  2843. $chatMsgAddrbaseOffset = 2848 ; -> &HB20
  2844.  
  2845. $chatMsgAddrbase2FirstLine = 58708 ; ->  &HE554
  2846. $chatMsgAddrbase2SecondLine = 59240 ; -> &HE768
  2847. $chatMsgAddrbase2ThirdLine = 59772 ; -> &HE97c
  2848. $chatMsgAddrbase2LastLine = 114036 ; -> &H1bd74
  2849. $searchbreak = "is about to break"
  2850.  
  2851. $charactername = 0x109BE0E0 ;-> character name address
  2852. $htlusernameaddress = 0x109FF290 ;-> username in htl
  2853. $minimumdamagerate = 0x10A03278 ;
  2854.  
  2855. $baseAddressDialog = 0x109BE23C ;-> dialog baseaddress
  2856. $invitedPartyOffset = 667 ; baseAddressDialog + 29B
  2857.  
  2858. $baseAddressDialogTrade = 0x109BE248 ;-> dialog baseaddress
  2859. $TradeOffset = 270 ; baseAddressDialog + 10E
  2860.  
  2861. _writeValue(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset), 49)
  2862. $dialogTradeRequest = _GetDialogData(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset))
  2863.  
  2864. $baseAddressDialogDuel = 0x10A03DF0 ;-> dialog baseaddress
  2865. _writeValue($baseAddressDialogDuel, 49)
  2866. $dialogDuelRequest = _GetDialogData($baseAddressDialogDuel)
  2867.  
  2868.  
  2869. $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  2870.  
  2871. _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  2872. $dialogParty = _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset))
  2873.  
  2874. $botmenu = GUICreate("Tantra Bot System! Version "&$versionnumber,400,430)
  2875.  
  2876. $statuslabel = GUICtrlCreateLabel ($defaultstatus,0,392,400,300,BitOr($SS_SIMPLE,$SS_SUNKEN))
  2877. $filemenu = GUICtrlCreateMenu ("&File")
  2878. $fileitem = GUICtrlCreateMenuitem ("Open",$filemenu)
  2879. GUICtrlSetState(-1,$GUI_DEFBUTTON)
  2880. $windowmenu = GUICtrlCreateMenu ("Menu")
  2881. $menumain = GUICtrlCreateMenuitem ("Main (ALT+SHIFT+M)",$windowmenu)
  2882. $menuteleport = GUICtrlCreateMenuitem ("Portal Hack (ALT+SHIFT+T)",$windowmenu)
  2883. $menuautologin = GUICtrlCreateMenuitem ("AutoLogin (ALT+SHIFT+A)",$windowmenu)
  2884. $viewstatusitem = GUICtrlCreateMenuitem ("Statusbar",$windowmenu)
  2885. GUICtrlSetState($viewstatusitem,$GUI_CHECKED)
  2886. $helpmenu = GUICtrlCreateMenu ("?")
  2887. $saveitem = GUICtrlCreateMenuitem ("Save",$filemenu)
  2888. ;$readme = GUICtrlCreateMenuitem ("ReadMe",$helpmenu)
  2889. $infoabout = GUICtrlCreateMenuitem ("About",$helpmenu)
  2890. $exititem = GUICtrlCreateMenuitem ("Exit",$filemenu)
  2891. ;$recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu,1)
  2892. $separator1 = GUICtrlCreateMenuitem ("",$filemenu,2)
  2893.  
  2894.  
  2895.  
  2896. $MonsterCombo = GUICtrlCreateEdit ("ANTI AVARA CARA"& @CRLF, 10,70,120,50,$ES_AUTOVSCROLL+$WS_VSCROLL)
  2897. GUICtrlSetData ($MonsterCombo, "Kemsa Tonyo"&@CRLF&"Mosa Tonyo"&@CRLF,1)
  2898.  
  2899.  
  2900.  
  2901.  
  2902. $checkReplyPM = GUICtrlCreateCheckbox ("Reply PM", 140, 10, 70, 20)
  2903. GUICtrlSetState(-1, 4)
  2904. $checkReplyText = GUICtrlCreateInput ("Pil0t p0h", 220,10,170,20)
  2905.  
  2906. $canceltraderequest = GUICtrlCreateCheckbox ("Cancel Trade/Duel", 140, 50, 110, 20)
  2907. GUICtrlSetState(-1, 1)
  2908. ;GUICtrlSetState($canceltraderequest, $GUI_DISABLE)
  2909. $canceltraderequestreply = GUICtrlCreateInput ("Sorry am busy", 250,50,170,20)
  2910.  
  2911. $checkboxautologin = GUICtrlCreateCheckbox ("Auto-Login", 140, 70, 80, 20)
  2912. GUICtrlSetState(-1, 4)
  2913.  
  2914. $autologindelay = GUICtrlCreateInput ("0", 220, 70, 60, 20)
  2915. GUICtrlSetState(-1, 4)
  2916.  
  2917. $autologindelaylabel = GUICtrlCreateLabel ("Delay b4 login (msec)", 280, 70, 140, 20)
  2918. GUICtrlSetState(-1, 4)
  2919.  
  2920.  
  2921. $antistuckup = GUICtrlCreateCheckbox ("Turn/Move when stuck", 140, 90, 130, 20)
  2922. GUICtrlSetState(-1, 1)
  2923.  
  2924. $autosilf = GUICtrlCreateCheckbox ("Auto Silfrijan", 300, 90, 130, 20)
  2925. GUICtrlSetState($autosilf , 4)
  2926. GUICtrlSetTip($autosilf,"Self-resu option")
  2927. $autosilfxcoord = GUICtrlCreateInput ("150", 320,110,40,18)
  2928. $autosilfycoord = GUICtrlCreateInput ("500", 320,130,40,18)
  2929. GUICtrlCreateLabel ("X",  300, 110, 20)
  2930. GUICtrlCreateLabel ("Y",  300, 130, 20)
  2931. GUICtrlSetState($autosilfxcoord, $GUI_DISABLE)
  2932. GUICtrlSetState($autosilfycoord, $GUI_DISABLE)
  2933.  
  2934.  
  2935. GUICtrlCreateLabel ("Spin in msec",  140, 110, 70)
  2936. GUICtrlCreateLabel ("Move in msec",  140, 130, 70)
  2937. $antistuckspin = GUICtrlCreateInput ("150", 210,110,40,18)
  2938. $antistuckmove = GUICtrlCreateInput ("500", 210,130,40,18)
  2939.  
  2940.  
  2941.  
  2942. $partyOK = GUICtrlCreateCheckbox ("Join party", 140, 30, 80, 20)
  2943. GUICtrlSetState(-1, 1)
  2944. $partyjoinedreply = GUICtrlCreateInput ("Thanks", 220,30,80,20)
  2945. GUICtrlSetState($partyjoinedreply , $GUI_ENABLE)
  2946. $partydeniedreply = GUICtrlCreateInput ("Sorry solo mode.", 300,30,90,20)
  2947. GUICtrlSetState($partydeniedreply , $GUI_DISABLE)
  2948.  
  2949.  
  2950. $checkLoot = GUICtrlCreateCheckbox ("Loot On/Off", 10, 10, 80, 20)
  2951. GUICtrlSetState(-1, 1)
  2952. $lootduration = GUICtrlCreateInput ("200", 90,10,30,18)
  2953. GUICtrlSetTip($lootduration,"Loot duration in msec")
  2954.  
  2955. $checkMonsterSelectTarget = GUICtrlCreateCheckbox ("Enable monster select", 10, 30, 120, 20)
  2956. GUICtrlSetState(-1, $MonsterSelectTargetFlag)
  2957. $ClearMonsterList = GUICtrlCreateButton("Clear",70,50,60,20)  ;Talk like GM enable/disable button
  2958. $AddMonsterList = GUICtrlCreateButton("Add",10,50,50,20)  ;Talk like GM enable/disable button
  2959.  
  2960. $StartBot = GUICtrlCreateButton("Start",10,370,120,20)  ;Talk like GM enable/disable button
  2961. GUICtrlSetState(-1,$GUI_ENABLE)
  2962.  
  2963. $EXITMAIN = GUICtrlCreateButton("Exit",270,370,120,20)  ;This causes the application to exit
  2964.  
  2965. ;GUICtrlCreateLabel ("www.bigbytes.net",  150, 370, 100)
  2966.  
  2967. $pausecheckbox = GUICtrlCreateCheckBox ("CHECK TO PAUSE BOT",  130, 370, 135)
  2968. GUICtrlSetState(-1,4)
  2969. ;GUICtrlCreateLabel ("Hotkeys: ALT+SHIFT+M = SHOW THIS MENU",  10, 330, 400)
  2970. ;GUICtrlCreateLabel ("Hotkeys: F8 = RUN, F9 = Spam Trade, F10 = Pause, F11 = Left Clicker ",  10, 350, 400)
  2971. $wintitle = GUICtrlCreateInput("Tantra Launcher",100, 345, 100)
  2972. GUICtrlCreateLabel ("Window Caption",  10, 345, 80)
  2973. ;$closetantrabutton = GUICtrlCreateButton("Tantra Launcher",100, 345, 100)
  2974.  
  2975. GUICtrlCreateLabel ("Skill Function",  10, 160, 80) ; first cell 50 width
  2976.  
  2977. GUICtrlCreateLabel ("Cool Time (msec)",  100, 160, 100) ; first cell 50 width
  2978. $F1Skill1 = GUICtrlCreateCheckbox ("F1 Skill 1", 10, 180, 60, 20)
  2979. GUICtrlSetState(-1, $lootflag)
  2980. $F1Skill1Delay = GUICtrlCreateInput ("200", 110,180,60,20)
  2981.  
  2982. $F1Skill2 = GUICtrlCreateCheckbox ("F1 Skill 2", 10, 200, 60, 20)
  2983. GUICtrlSetState(-1, $lootflag)
  2984. $F1Skill2Delay = GUICtrlCreateInput ("200", 110,200,60,20)
  2985.  
  2986. $F1Skill3 = GUICtrlCreateCheckbox ("F1 Skill 3", 10, 220, 60, 20)
  2987. GUICtrlSetState(-1, $lootflag)
  2988. $F1Skill3Delay = GUICtrlCreateInput ("200", 110,220,60,20)
  2989.  
  2990. $F1Skill4 = GUICtrlCreateCheckbox ("F1 Skill 4", 10, 240, 60, 20)
  2991. GUICtrlSetState(-1, $lootflag)
  2992. $F1Skill4Delay = GUICtrlCreateInput ("200", 110,240,60,20)
  2993.  
  2994. $F1Skill7 = GUICtrlCreateCheckbox ("F1 YudaHeal 7", 10, 260, 90, 20)
  2995. GUICtrlSetState(-1, $lootflag)
  2996. GUICtrlSetTip($F1Skill7,"Yuda specific option, disable if you are not yuda")
  2997. $F1Skill7Delay = GUICtrlCreateInput ("2000", 110,260,40,20)
  2998. $F1Skill7percent = GUICtrlCreateInput ("70", 155,260,30,20)
  2999. GUICtrlSetTip($F1Skill7percent,"Execute heal if below this value, loop until hp is above this value.")
  3000. GUICtrlCreateLabel (" %",  185, 260, 30)    ; first cell 50 width
  3001.  
  3002.  
  3003. $F1Skill8 = GUICtrlCreateCheckbox ("F1 HP Pots 8", 10, 280, 90, 20)
  3004. GUICtrlSetState(-1, 4)
  3005. $F1Skill8Delay = GUICtrlCreateInput ("2000", 110,280,40,20)
  3006. $F1Skill8percent = GUICtrlCreateInput ("70", 155,280,30,20)
  3007. GUICtrlCreateLabel (" %",  185, 280, 30)    ; first cell 50 width
  3008.  
  3009. $F1Skill9 = GUICtrlCreateCheckbox ("F1 TP Pots 9", 10, 300, 90, 20)
  3010. GUICtrlSetState(-1, 4)
  3011. $F1Skill9Delay = GUICtrlCreateInput ("2000", 110,300,40,20)
  3012. $F1Skill9percent = GUICtrlCreateInput ("70", 155,300,30,20)
  3013. GUICtrlCreateLabel (" %",  185, 300, 30)    ; first cell 50 width
  3014.  
  3015. $DelayAfterFindTargetCheckBox = GUICtrlCreateCheckbox ("Delay B4 Skill", 10, 320, 90, 20)
  3016. GUICtrlSetState(-1, 1)
  3017. $DelayAfterFindTargetDelay = GUICtrlCreateInput ("1000", 110,320,40,20)
  3018.  
  3019.  
  3020. GUICtrlCreateLabel ("Buff Function",  210, 160, 80) ; first cell 50 width
  3021. GUICtrlCreateLabel ("Duration (msec)",  300, 160, 100)  ; first cell 50 width
  3022.  
  3023. $F2Skill1 = GUICtrlCreateCheckbox ("F2 Buff 1", 210, 180, 60, 20)
  3024. GUICtrlSetState(-1, $lootflag)
  3025. $F2Skill1Delay = GUICtrlCreateInput ("480000", 310,180,60,20)
  3026.  
  3027. $F2Skill2 = GUICtrlCreateCheckbox ("F2 Buff 2", 210, 200, 60, 20)
  3028. GUICtrlSetState(-1, $lootflag)
  3029. $F2Skill2Delay = GUICtrlCreateInput ("600000", 310,200,60,20)
  3030.  
  3031. $F2Skill3 = GUICtrlCreateCheckbox ("F2 Buff 3", 210, 220, 60, 20)
  3032. GUICtrlSetState(-1, $lootflag)
  3033. $F2Skill3Delay = GUICtrlCreateInput ("300000", 310,220,60,20)
  3034.  
  3035. $F2Skill4 = GUICtrlCreateCheckbox ("F2 Buff 4", 210, 240, 60, 20)
  3036. GUICtrlSetState(-1, 4)
  3037. $F2Skill4Delay = GUICtrlCreateInput ("300000", 310,240,60,20)
  3038.  
  3039. $F2Skill6 = GUICtrlCreateCheckbox ("F2 TradeSpam 6", 210, 260, 95, 20)
  3040. GUICtrlSetState(-1, 4)
  3041. $F2Skill6Delay = GUICtrlCreateInput ("2000", 310,260,60,20)
  3042.  
  3043. $F2Skill7 = GUICtrlCreateCheckbox ("F2 YudaHeal 7", 210, 280, 90, 20)
  3044. GUICtrlSetState(-1, $lootflag)
  3045. $F2Skill7Delay = GUICtrlCreateInput ("2000", 310,280,60,20)
  3046.  
  3047. $F2Skill9 = GUICtrlCreateCheckbox ("F2 Repair 9", 210, 300, 80, 20)
  3048. GUICtrlSetState(-1, $lootflag)
  3049. $F2Skill9Delay = GUICtrlCreateInput ("2000", 310,300,60,20)
  3050.  
  3051. $buff1flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3052. $buff2flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3053. $buff3flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3054. $buff4flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3055. $buffrepairflag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3056.  
  3057. $checkSkill = GUICtrlCreateCheckbox ("Skill On/Off", 10, 140, 80, 20)
  3058. GUICtrlSetState(-1, 1)
  3059. $checkSkillR = GUICtrlCreateCheckbox ("R", 90, 140, 30, 20)
  3060. GUICtrlSetState(-1, 1)
  3061. GUICtrlSetTip($checkSkillR, "Uncheck this option for Mage")
  3062. $checkRepair = GUICtrlCreateCheckbox ("Auto Repair", 10, 120, 120, 20)
  3063. GUICtrlSetState(-1, 4)
  3064. GUICtrlSetState($F2Skill9Delay, $GUI_DISABLE)
  3065. GUICtrlSetState($F2Skill9, $GUI_DISABLE)
  3066. GUICtrlSetState($F2Skill9, 4)
  3067.  
  3068.  
  3069. $autologinmenu = GUICreate("Auto-Login: booster101")  ; will create a dialog box that when displayed is centered
  3070. $currentdir = @WorkingDir
  3071.  
  3072. $filemenu2 = GUICtrlCreateMenu ("&File")
  3073. $fileitem2 = GUICtrlCreateMenuitem ("Open",$filemenu2)
  3074. GUICtrlSetState(-1,$GUI_DEFBUTTON)
  3075. $windowmenu2 = GUICtrlCreateMenu ("Menu")
  3076. $menumain2 = GUICtrlCreateMenuitem ("Main (ALT+SHIFT+M)",$windowmenu2)
  3077. $menuteleport2 = GUICtrlCreateMenuitem ("Portal Hack (ALT+SHIFT+T)",$windowmenu2)
  3078. $menuautologin2 = GUICtrlCreateMenuitem ("AutoLogin (ALT+SHIFT+A)",$windowmenu2)
  3079. $helpmenu2 = GUICtrlCreateMenu ("?")
  3080. $saveitem2 = GUICtrlCreateMenuitem ("Save",$filemenu2)
  3081. $infoabout2 = GUICtrlCreateMenuitem ("About",$helpmenu2)
  3082. $exititem2 = GUICtrlCreateMenuitem ("Exit",$filemenu2)
  3083. $separator2 = GUICtrlCreateMenuitem ("",$filemenu2,2)
  3084.  
  3085.  
  3086. $username=GUICtrlCreateInput ("", 70,10,100,20)
  3087. GUICtrlCreateLabel ("Username", 10, 10, 60, 20)
  3088.  
  3089. $password=GUICtrlCreateInput ("", 250,10,100,20,$ES_PASSWORD)
  3090. GUICtrlCreateLabel ("Password", 180, 10, 60, 20)
  3091.  
  3092. $characterselect = GUICtrlCreateCombo ("Character1", 70,35,100) ; create first item
  3093. GUICtrlSetData(-1,"Character2|Character3","Character1")
  3094. GUICtrlCreateLabel ("Char Select", 10, 35, 60, 20)
  3095.  
  3096. $serverselect = GUICtrlCreateCombo ("Manas", 250,35,100) ; create first item
  3097. GUICtrlSetData(-1,"Diyana|Kriya|Samadi|Warzone","Diyana")
  3098. GUICtrlCreateLabel ("Server Select", 180, 35, 70, 20)
  3099.  
  3100. $delay1=GUICtrlCreateInput ("3000", 10,60,50,20)
  3101. GUICtrlCreateLabel ("Wait for Tantra", 70, 60, 100, 20)
  3102.  
  3103. $delay2=GUICtrlCreateInput ("25000", 10,90,50,20)
  3104. GUICtrlCreateLabel ("Wait for login", 70, 90, 100, 20)
  3105.  
  3106. $delay3=GUICtrlCreateInput ("10000", 10,120,50,20)
  3107. GUICtrlCreateLabel ("Delay after login", 70, 120, 100, 20)
  3108.  
  3109. $delay4=GUICtrlCreateInput ("45000", 200,60,50,20)
  3110. GUICtrlCreateLabel ("Delay after server select", 260, 60, 150, 20)
  3111.  
  3112. $delay5=GUICtrlCreateInput ("5000", 200,90,50,20)
  3113. GUICtrlCreateLabel ("Delay after char select", 260, 90, 150, 20)
  3114.  
  3115. $delay6=GUICtrlCreateInput ("5000", 200,120,50,20)
  3116. GUICtrlCreateLabel ("Delay for Quiz", 260, 120, 100, 20)
  3117.  
  3118. ;$myXcoord=GUICtrlCreateInput ("50", 280,310,30,20)
  3119. ;$myYcoord=GUICtrlCreateInput ("50", 370,310,30,20)
  3120.  
  3121.  
  3122.  
  3123. $question=GUICtrlCreateInput ("Quiz question here.", 10,150,370,20)
  3124.  
  3125. $answerupperleft=GUICtrlCreateInput ("Choice1", 10,180,100,20)
  3126. GUICtrlCreateLabel ("X", 110, 180, 20, 20)
  3127. GUICtrlCreateLabel ("Y", 150, 180, 20, 20)
  3128. $upperleftX=GUICtrlCreateInput ("186", 120,180,30,20)
  3129. $upperleftY=GUICtrlCreateInput ("316", 160,180,30,20)
  3130. GUICtrlCreateLabel ("ALT+1 FOR X/Y", 10, 200, 200, 20)
  3131.  
  3132. $answerupperright=GUICtrlCreateInput ("Choice2", 200,180,100,20)
  3133. GUICtrlCreateLabel ("X", 300, 180, 20, 20)
  3134. GUICtrlCreateLabel ("Y", 340, 180, 20, 20)
  3135. $upperrightX=GUICtrlCreateInput ("383", 310,180,30,20)
  3136. $upperrightY=GUICtrlCreateInput ("317", 350,180,30,20)
  3137. GUICtrlCreateLabel ("ALT+3 FOR X/Y", 200, 200, 200, 20)
  3138.  
  3139. $answerlowerleft=GUICtrlCreateInput ("Choice3", 10,240,100,20)
  3140. GUICtrlCreateLabel ("X", 110, 240, 20, 20)
  3141. GUICtrlCreateLabel ("Y", 150, 240, 20, 20)
  3142. $lowerleftX=GUICtrlCreateInput ("191", 120,240,30,20)
  3143. $lowerleftY=GUICtrlCreateInput ("342", 160,240,30,20)
  3144. GUICtrlCreateLabel ("ALT+2 FOR X/Y", 10, 260, 200, 20)
  3145.  
  3146. $answerlowerright=GUICtrlCreateInput ("Choice4", 200,240,100,20)
  3147. GUICtrlCreateLabel ("X", 300, 240, 20, 20)
  3148. GUICtrlCreateLabel ("Y", 340, 240, 20, 20)
  3149. $lowerrightX=GUICtrlCreateInput ("380", 310,240,30,20)
  3150. $lowerrightY=GUICtrlCreateInput ("341", 350,240,30,20)
  3151. GUICtrlCreateLabel ("ALT+4 FOR X/Y", 200, 260, 200, 20)
  3152.  
  3153. $LOGIN = GUICtrlCreateButton("LogIn Once",150,350,120,20)
  3154. ;$AUTOLOGIN = GUICtrlCreateButton("Auto-LogIn",150,320,120,20)
  3155. $BACK = GUICtrlCreateButton("Bot Menu",280,350,120,20)  ;This causes the application to exit
  3156. $DIALOG = GUICtrlCreateButton("Ans Quiz",10,350,120,20)
  3157.  
  3158. GUICtrlCreateLabel("Hotkey to show this Menu: ALT+SHIFT+A",10,320,250,20)
  3159.  
  3160. ;$FILERUN = GUICtrlCreateButton("File",10,330,120,20)
  3161.  
  3162. $tantradir=GUICtrlCreateInput ("C:\Program Files\Tantra\", 10,290,300,20)
  3163.  
  3164. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3165. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3166.  
  3167. $questionAddress = 0x10A069BC
  3168. $choiceupperleftAddress = 0x10A06DBC
  3169. $choicelowerleftAddress = 0x10A06DE4
  3170. $choiceupperrightAddress = 0x10A06DD0
  3171. $choicelowerrightAddress = 0x10A06DF8
  3172.  
  3173.  
  3174. $teleportgui = GUICreate("Mandara Teleport Hack: booster101")  ; will create a dialog box that when displayed is centered
  3175.  
  3176.  
  3177. $filemenu3 = GUICtrlCreateMenu ("&File")
  3178. $fileitem3 = GUICtrlCreateMenuitem ("Open",$filemenu3)
  3179. GUICtrlSetState(-1,$GUI_DEFBUTTON)
  3180. $windowmenu3 = GUICtrlCreateMenu ("Menu")
  3181. $menumain3 = GUICtrlCreateMenuitem ("Main (ALT+SHIFT+M)",$windowmenu3)
  3182. $menuteleport3 = GUICtrlCreateMenuitem ("Portal Hack (ALT+SHIFT+T)",$windowmenu3)
  3183. $menuautologin3 = GUICtrlCreateMenuitem ("AutoLogin (ALT+SHIFT+A)",$windowmenu3)
  3184. $helpmenu3 = GUICtrlCreateMenu ("?")
  3185. $saveitem3 = GUICtrlCreateMenuitem ("Save",$filemenu3)
  3186. $infoabout3 = GUICtrlCreateMenuitem ("About",$helpmenu3)
  3187. $exititem3 = GUICtrlCreateMenuitem ("Exit",$filemenu3)
  3188. ;$recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu3,1)
  3189. $separator3 = GUICtrlCreateMenuitem ("",$filemenu3,2)
  3190.  
  3191.  
  3192.  
  3193. $APP1_ComboBOX = GUICtrlCreateCombo ("Mandara Village", 10,180) ; create first item
  3194. GUICtrlSetData(-1,"Mandara Portal|Entrance to Mara Land|Way to Coliseum|Entrance to Shambala|Anu Village|Shambala Castle|Holy Army's Barracks|Town of Ruins|Town of Ruins Westside Forest(1000)|Horseman Town Well|Horseman Dungeon 1st(600)|Horseman Dungeon 1st end|Horseman Dungeon 2nd(800)|Shambala Dungeon|Shambala Dungeon 1st(600)|Shambala Dungeon 1st end|Shambala Dungeon 2st(1000)|Shambala Castle|Jina Village Portal|Rest Place(400)|Country Borderline(400)|Small Sea Port|Pamir Plains(400)|Mantra Temple|Village of the Outcast|Flower Field(400)|Temple of Fire(400)|Brahma Castle|Vishnu Castle|Shiva Castle|Brahman Front Line|Brahman Right Flank|Brahman Left Flank|Vishnite Front Line|Vishnite Right Flank|Vishnite Left Flank|Shivan Front Line|Shivan Right Flank|Shivan Left Flank|Brahman Chaturanga|SHivan Chaturanga|Vishnite Chaturanga|Emperor's Tomb Entrance|[Not Yet Implemented]|West Tomb(20000)|East Tomb(20000)|Mahi Durga|Ahb Durga|Danva Durga|Nar Durga|Mahi Durga Gate|Ahb Durga Gate|Danva Durga Gate|Nar Durga Gate|Mahi Durga Stronghold|Ahb Durga Stronghold|Danva Durga Stronghold|Nar Durga Stronghold|Mahi Conference Hall|Ahb Conference Hall|Danva Conference Hall|Nar Conference Hall|Mahi Kaustbam|Ahb Kaustbam|Danva Kaustbam|Nar Kaustbam|Town Biryu|Biryu Commercial Area|Biryu Downtown Area|[Not Yet Implemented]|Mudha Dungeon[x]","Mandara Village") ; add other item snd set a new default
  3195.  
  3196.  
  3197. $RUN = GUICtrlCreateButton("Hack Portal",10,350,120,20)  ;This in the Run button
  3198. $RUN2 = GUICtrlCreateButton("Search Address",140,350,120,20)  ;Talk like GM enable/disable button
  3199. $BACK2 = GUICtrlCreateButton("Bot Menu",270,350,120,20)  ;This causes the application to exit
  3200.  
  3201.  
  3202. GUICtrlCreateLabel ("How to use Mandara Teleport hack.",  10, 20, 300)
  3203. GUICtrlCreateLabel ("Click Search Address button to update Target Address.",  10, 50, 300)
  3204. GUICtrlCreateLabel ("Wait till the search is finished.",  10, 65, 300)
  3205. GUICtrlCreateLabel ("Go to Mandara portal.",  10, 80, 300)
  3206. GUICtrlCreateLabel ("Go to Select destination.",  10, 95, 300)
  3207. GUICtrlCreateLabel ("Then click Hack Portal button.",  10, 110, 300)
  3208. GUICtrlCreateLabel ("Click the portal then click on your target destination.",  10, 125, 300)
  3209. GUICtrlCreateLabel ("Note: Update Target Address value ONCE per Tantra session.",  10, 125, 300)
  3210.  
  3211.  
  3212. ;$messageBox = GUICtrlCreateCheckbox ("Enable MsgBox per cycle", 10, 160, 150, 20)
  3213.  
  3214. $bytes2read = GUICtrlCreateInput ("1000000", 10,210,120,20)
  3215. GUICtrlCreateLabel("Number of bytes per Read",130, 210, 130)
  3216.  
  3217. $searchStart = GUICtrlCreateInput ("4194304", 10,230,130,20)
  3218. GUICtrlCreateLabel("Start Address",130, 230, 130)
  3219.  
  3220. $searchEnd = GUICtrlCreateInput ("2147483647", 10,250,120,20)
  3221. GUICtrlCreateLabel("End Address",130, 250, 130)
  3222.  
  3223. $searchBytes = GUICtrlCreateInput ("6800000069000000A1000000A2000000A3", 10,270,230,20)
  3224. GUICtrlCreateLabel("Array of bytes to search",240, 270, 130)
  3225. $currentaddress = GUICtrlCreateLabel ("current search address",  10, 290, 200)
  3226.  
  3227. $searchlen = StringLen(GUICtrlRead($searchBytes))/2
  3228.  
  3229. $inputAddress = GUICtrlCreateInput ("9B8EAC4", 10,320,120,20)
  3230. GUICtrlCreateLabel("Target Address",130, 320, 80)
  3231.  
  3232.  
  3233.  
  3234. GUISwitch($botmenu)
  3235.  
  3236. Call ("MenuLaunch")
  3237.  
  3238. ;********** Trade Spam **********
  3239.  
  3240. Func TradeSpam ()
  3241.  
  3242. Msgbox(0,"Trade Spam","To adjust delay to compensate for ingame lag, use F2 TradeSpam 6 duration input box")
  3243.  
  3244. While (1)
  3245.  
  3246. Send ("{F2}6 ")
  3247. Sleep (Number(GUICtrlRead($F2Skill6Delay)))
  3248. MouseClick ("Left")
  3249. Call ("Unfocus")
  3250. MouseUp ("Left")
  3251. Sleep (Number(GUICtrlRead($F2Skill6Delay)))
  3252. ;Send (" ", 1)
  3253. Send ("{ENTER} ")
  3254.  
  3255.  
  3256. WEnd
  3257. EndFunc
  3258.  
  3259. ;********** Left Clicker **********
  3260.  
  3261. Func Left_Click2 ()
  3262.  
  3263. Msgbox(0,"Left Clicker","To adjust click speed, use F2 TradeSpam 6 duration input box")
  3264.  
  3265. While (1)
  3266.  
  3267. MouseClick ("Left")
  3268. Call ("Unfocus")
  3269. MouseUp ("Left")
  3270. Sleep (Number(GUICtrlRead($F2Skill6Delay)))
  3271.  
  3272.  
  3273.  
  3274.  
  3275. WEnd
  3276. EndFunc
  3277.  
  3278.  
  3279. ;********** Auto 5 F8**********
  3280.  
  3281. Func Auto_5 ()
  3282.  
  3283. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3284. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3285.  
  3286. If Not WinExists(GUICtrlRead($wintitle)) And Not ProcessExists("HTLauncher.exe") Then
  3287.     If GUICtrlRead($checkboxautologin) = 4 then
  3288.        MsgBox(0, "Tantra Process", "Run the Tantra client first before pressing F8 Or use the auto-login feature.")
  3289.        Send("+!m")
  3290.     EndIf
  3291. Else
  3292.  
  3293.     _writeValue(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset), 49)
  3294.     $dialogTradeRequest = _GetDialogData(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset))
  3295.     $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  3296.     _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  3297.     $dialogParty = _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset))
  3298.     _writeValue($baseAddressDialogDuel, 49)
  3299.         $dialogDuelRequest = _GetDialogData($baseAddressDialogDuel)
  3300.         ;MsgBox(0,"Info","username in htl is "&_readText2($htlusernameaddress))
  3301. EndIf
  3302.  
  3303. While (1)
  3304.  
  3305. checkifdisconnected()
  3306.  
  3307. If WinExists(GUICtrlRead($wintitle)) then
  3308.         Call ("check4Repair")
  3309.     Call ("AutoSilf")
  3310.     Call("_replyToPM")
  3311.     $myDamage = _GetData($baseAddressCharacter,$myMaxHPoffset - 4)
  3312.     Call ("buff1")
  3313.     Call ("buff2")
  3314.     Call ("buff3")
  3315.     Call ("buff4")
  3316.     Call ("CheckPartyDialog")
  3317.     Call ("CheckTradeRequestDialog")
  3318.     Call ("CheckDuelRequestDialog")
  3319.     Call("_replyToPM")
  3320.     Call ("FindTarget2")
  3321.     Call ("skill1")
  3322.     Call ("loot1")
  3323.     Call("_replyToPM")
  3324.     Call ("FindTarget2")
  3325.     Call ("skill2")
  3326.     Call ("CheckPartyDialog")
  3327.     Call ("CheckTradeRequestDialog")
  3328.     Call ("CheckDuelRequestDialog")
  3329.     antistuck($myDamage)
  3330.     Call ("loot1")
  3331.     Call("_replyToPM")
  3332.     Call ("FindTarget2")
  3333.     Call ("skill4")
  3334.     Call ("loot1")
  3335.     Call("_replyToPM")
  3336.     Call ("FindTarget2")
  3337.     Call ("skill3")
  3338.     antistuck($myDamage)
  3339.     Call ("loot1")
  3340.     Call("_replyToPM")
  3341.     Call ("FindTarget2")
  3342.     Call ("CheckPartyDialog")
  3343.     Call ("CheckTradeRequestDialog")
  3344.     Call ("CheckDuelRequestDialog")
  3345.     $count2 = $count2 + 1
  3346. EndIf
  3347.  
  3348. WEnd
  3349.  
  3350. EndFunc
  3351.  
  3352.  
  3353. ;********** Stop **********
  3354.  
  3355. ; Stops The Program.
  3356.  
  3357. Func Stop ()
  3358.  
  3359. ;$handle = WinGetHandle(GUICtrlRead($wintitle))
  3360.  
  3361. WinActivate("Tantra Bot System!")
  3362. $count = 0
  3363. $count2 = 0
  3364. GUICtrlSetData($statuslabel,"Paused....")
  3365. Send("+!m")
  3366.  
  3367. While 1 = 1
  3368.     $count = 0
  3369.     $count2 = 0
  3370.     Sleep (1000)
  3371. Wend
  3372.  
  3373. EndFunc
  3374.  
  3375.  
  3376. ;********** Repeater **********
  3377.  
  3378. ; Continuous Loop Of Program.
  3379.  
  3380. While (1)
  3381. Sleep (1)
  3382. WEnd
  3383.  
  3384.  
  3385. ;********** Functions: Delay **********
  3386.  
  3387. ; Delay Interval In Between Skills.
  3388.  
  3389. Func Delay_1 ()
  3390.  
  3391. Sleep (1000)
  3392. EndFunc
  3393.  
  3394. Func Delay_2 ()
  3395. Sleep (2000)
  3396. EndFunc
  3397.  
  3398. Func Delay_3 ()
  3399. ControlSend($handle, "", "","{r down}")
  3400. Sleep (300)
  3401. ControlSend($handle, "", "","{r up}")
  3402. EndFunc
  3403.  
  3404. Func Delay_4 ()
  3405.  
  3406. Sleep (400)
  3407. EndFunc
  3408.  
  3409. Func Delay ()
  3410.  Sleep (1000)
  3411. EndFunc
  3412.  
  3413. ;********** Functions: Skill **********
  3414.  
  3415. Func skill1 ()
  3416.   CheckIfPause()
  3417.   GetCharacterStatus()
  3418.   If GUICtrlRead($checkSkill) = 1 then
  3419.      If GUICtrlRead($F1Skill1) = 1 then
  3420.     Call ("TP_Pots")
  3421.     ControlSend($handle, "", "","{1 down}")
  3422.     Sleep (Number(GUICtrlRead($F1Skill1Delay)))
  3423.     ControlSend($handle, "", "","{1 up}")
  3424.      Else
  3425.        If GuICtrlRead($checkSkillR) = 1 then
  3426.      ControlSend($handle, "", "","r ")
  3427.        EndIf
  3428.      Endif
  3429.   Else
  3430.        If GuICtrlRead($checkSkillR) = 1 then
  3431.     ControlSend($handle, "", "","r ")
  3432.        EndIf
  3433.   EndIf
  3434. EndFunc
  3435.  
  3436. Func skill2 ()
  3437.   CheckIfPause()
  3438.   GetCharacterStatus()
  3439.   If GUICtrlRead($checkSkill) = 1 then
  3440.      If GUICtrlRead($F1Skill2) = 1 then
  3441.     Call ("TP_Pots")
  3442.     ControlSend($handle, "", "","{2 down}")
  3443.     Sleep (Number(GUICtrlRead($F1Skill2Delay)))
  3444.     ControlSend($handle, "", "","{2 up}")
  3445.      Else
  3446.        If GuICtrlRead($checkSkillR) = 1 then
  3447.      ControlSend($handle, "", "","r ")
  3448.        EndIf
  3449.      Endif
  3450.   Else
  3451.        If GuICtrlRead($checkSkillR) = 1 then
  3452.      ControlSend($handle, "", "","r ")
  3453.        EndIf
  3454.   EndIf
  3455. EndFunc
  3456.  
  3457. Func skill3 ()
  3458.   CheckIfPause()
  3459.   GetCharacterStatus()
  3460.   If GUICtrlRead($checkSkill) = 1 then
  3461.      If GUICtrlRead($F1Skill3) = 1 then
  3462.     Call ("TP_Pots")
  3463.     ControlSend($handle, "", "","{3 down}")
  3464.     Sleep (Number(GUICtrlRead($F1Skill3Delay)))
  3465.     ControlSend($handle, "", "","{3 up}")
  3466.      Else
  3467.        If GuICtrlRead($checkSkillR) = 1 then
  3468.      ControlSend($handle, "", "","r ")
  3469.        EndIf
  3470.      Endif
  3471.   Else
  3472.        If GuICtrlRead($checkSkillR) = 1 then
  3473.      ControlSend($handle, "", "","r ")
  3474.        EndIf
  3475.   EndIf
  3476.  
  3477. EndFunc
  3478.  
  3479. Func skill4 ()
  3480.   CheckIfPause()
  3481.   GetCharacterStatus()
  3482.   If GUICtrlRead($checkSkill) = 1 then
  3483.      If GUICtrlRead($F1Skill4) = 1 then
  3484.     Call ("TP_Pots")
  3485.     ControlSend($handle, "", "","{4 down}")
  3486.     Sleep (Number(GUICtrlRead($F1Skill4Delay)))
  3487.     ControlSend($handle, "", "","{4 up}")
  3488.      Else
  3489.        If GuICtrlRead($checkSkillR) = 1 then
  3490.      ControlSend($handle, "", "","r ")
  3491.        EndIf
  3492.      Endif
  3493.   Else
  3494.        If GuICtrlRead($checkSkillR) = 1 then
  3495.      ControlSend($handle, "", "","r ")
  3496.        EndIf
  3497.   EndIf
  3498. EndFunc
  3499.  
  3500. Func loot1 ()
  3501.    CheckIfPause()
  3502.    GetCharacterStatus()
  3503.    If GUICtrlRead($checkLoot) = 1 then
  3504.       ControlSend($handle, "", "","{f down}")
  3505.       Sleep (Number(GUICtrlRead($lootduration)))
  3506.       ControlSend($handle, "", "","{f up}")
  3507.    EndIf
  3508. EndFunc
  3509.  
  3510. ;********** Functions: A1 **********
  3511.  
  3512. Func A1 ()
  3513.  
  3514. ControlSend($handle, "", "","1 ")
  3515. Sleep (50)
  3516. EndFunc
  3517.  
  3518. ;********** Functions: A2 **********
  3519.  
  3520. Func A2 ()
  3521.  
  3522. ControlSend($handle, "", "","1 ")
  3523. Sleep (50)
  3524. EndFunc
  3525.  
  3526.  
  3527. ;********** Functions: FindTarget2 **********
  3528.  
  3529. Func FindTarget2 ()
  3530. CheckIfPause()
  3531. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3532. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3533. GetCharacterStatus()
  3534.  
  3535. If $MonsterSelectTargetFlag = 1 then
  3536.  
  3537. $flag = 0
  3538.  
  3539. Do
  3540.    $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  3541. if $curHP <> 0 then
  3542.    ControlSend($handle, "", "","te ")
  3543.    Sleep (500)
  3544.    $t = StringUpper(_GetMonsterName($baseAddressTargetMonster))
  3545.    If  StringInStr(StringUpper(GUICtrlRead($MonsterCombo,1)),$t) >= 1   then
  3546.     $flag = 1
  3547.     If GUICtrlRead($checkSkillR) = 1 then
  3548.         ControlSend($handle, "", "","r ")
  3549.     EndIf
  3550.     If GUICtrlRead($DelayAfterFindTargetCheckBox) = 1 then
  3551.        Sleep(Number(GUICtrlRead($DelayAfterFindTargetDelay)))
  3552.     EndIf
  3553.    Else
  3554.     If GUICtrlRead($checkSkillR) = 1 Or GUICtrlRead($checkSkill) = 1 then
  3555.        Call ("Click_Name")
  3556.        ControlSend($handle, "", "","{a down}")
  3557.        Sleep (Number(GUICtrlRead($antistuckspin)))
  3558.        ControlSend($handle, "", "","{a up}")
  3559.        ControlSend($handle, "", "","{w down}")
  3560.        Sleep (Number(GUICtrlRead($antistuckmove)))
  3561.        ControlSend($handle, "", "","{w up}")
  3562.         EndIf
  3563.    EndIf
  3564. Else
  3565.    $flag = 1
  3566.    Call ("AutoSilf")
  3567. EndIf
  3568.    ;MsgBox(0,"Info", "flag is "&$flag&" target is "&$t)
  3569.  
  3570. Until $flag = 1
  3571.  
  3572. Else
  3573.    If GUICtrlRead($checkSkillR) = 1 then
  3574.       ControlSend($handle, "", "","ter ")
  3575.    ElseIf GUICtrlRead($checkSkill) = 1 then
  3576.       ControlSend($handle, "", "","te ")
  3577.    EndIf
  3578.    Sleep (500)
  3579. EndIf
  3580.  
  3581. If GUICtrlRead($checkSkillR) = 1 Or GUICtrlRead($checkSkill) = 1  then
  3582.  Sleep (5)
  3583.  Call ("Heal_30")
  3584.  Call ("Heal_Pots")
  3585. EndIf
  3586.  
  3587. EndFunc
  3588.  
  3589. ;********** Functions: Anti-stuckup **********
  3590.  
  3591. Func antistuck ($myDamage)
  3592. CheckIfPause()
  3593. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3594. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3595.  
  3596.    If GUICtrlRead($antistuckup) = 1 then
  3597.     $myDamage2 = _GetData($baseAddressCharacter,$myMaxHPoffset - 4)
  3598.         ;MsgBox(0,"Info", "myDamage = "&String($myDamage)& @CRLF &"myDamage2 = "&String($myDamage2))
  3599.         If $myDamage = $myDamage2 then
  3600.         Call ("Click_Name")
  3601.         ControlSend($handle, "", "","{a down}")
  3602.         Sleep (Number(GUICtrlRead($antistuckspin)))
  3603.         ControlSend($handle, "", "","{a up}")
  3604.         ControlSend($handle, "", "","{w down}")
  3605.         Sleep (Number(GUICtrlRead($antistuckmove)))
  3606.         ControlSend($handle, "", "","{w up}")
  3607.     EndIf
  3608.     EndIf
  3609. EndFunc
  3610.  
  3611.  
  3612. ;********** Functions: Buff **********
  3613.  
  3614. Func buff1 ()
  3615.  
  3616.   CheckIfPause()
  3617.   GetCharacterStatus()
  3618.   If GUICtrlRead($checkSkill) = 1 then
  3619.      If GUICtrlRead($F2Skill1) = 1 then
  3620.        If ((_DateDiff( 's',"1970/01/01 00:00:00",_NowCalc()) - $buff1flag) * 1000) >= Number(GUICtrlRead($F2Skill1Delay)) Or $count2 = 0 then
  3621.     If Not $count2 = 0 Then
  3622.         Call ("FindTarget2")
  3623.         Sleep (2000)
  3624.     EndIf
  3625.     ControlSend($handle, "", "","{F2} ")
  3626.     Sleep(100)
  3627.     ControlSend($handle, "", "","1 ")
  3628.     Sleep(100)
  3629.     $buff1flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3630.     Sleep (2000)
  3631.     ControlSend($handle, "", "","{F1} ")
  3632.        EndIf
  3633.      Endif
  3634.   EndIf
  3635. EndFunc
  3636.  
  3637. Func buff2 ()
  3638.   CheckIfPause()
  3639.   GetCharacterStatus()
  3640.   If GUICtrlRead($checkSkill) = 1 then
  3641.      If GUICtrlRead($F2Skill2) = 1 then
  3642.        If ((_DateDiff( 's',"1970/01/01 00:00:00",_NowCalc()) - $buff2flag) * 1000) >= Number(GUICtrlRead($F2Skill2Delay)) Or $count2 = 0 then
  3643.     If Not $count2 = 0 Then
  3644.         Call ("FindTarget2")
  3645.     EndIf
  3646.     Sleep (2000)
  3647.     ControlSend($handle, "", "","{F2} ")
  3648.     Sleep(100)
  3649.     ControlSend($handle, "", "","2 ")
  3650.     Sleep(100)
  3651.     $buff2flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3652.     Sleep (2000)
  3653.     ControlSend($handle, "", "","{F1} ")
  3654.        EndIf
  3655.      Endif
  3656.   EndIf
  3657. EndFunc
  3658.  
  3659. Func buff3 ()
  3660.   CheckIfPause()
  3661.   GetCharacterStatus()
  3662.   If GUICtrlRead($checkSkill) = 1 then
  3663.      If GUICtrlRead($F2Skill3) = 1 then
  3664.        If ((_DateDiff( 's',"1970/01/01 00:00:00",_NowCalc()) - $buff3flag) * 1000) >= Number(GUICtrlRead($F2Skill3Delay)) Or $count2 = 0 then
  3665.     If Not $count2 = 0 Then
  3666.         Call ("FindTarget2")
  3667.     EndIf
  3668.     ControlSend($handle, "", "","{F2} ")
  3669.     Sleep (2000)
  3670.     ControlSend($handle, "", "","3 ")
  3671.     Sleep(100)
  3672.     $buff3flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3673.     Sleep (2000)
  3674.     ControlSend($handle, "", "","{F1} ")
  3675.     Sleep(50)
  3676.        EndIf
  3677.      Endif
  3678.   EndIf
  3679. EndFunc
  3680.  
  3681. Func buff4 ()
  3682.   CheckIfPause()
  3683.   GetCharacterStatus()
  3684.   If GUICtrlRead($checkSkill) = 1 then
  3685.      If GUICtrlRead($F2Skill4) = 1 then
  3686.        If ((_DateDiff( 's',"1970/01/01 00:00:00",_NowCalc()) - $buff4flag) * 1000) >= Number(GUICtrlRead($F2Skill4Delay)) Or $count2 = 0 then
  3687.     If Not $count2 = 0 Then
  3688.         Call ("FindTarget2")
  3689.     EndIf
  3690.     ControlSend($handle, "", "","{F2} ")
  3691.     Sleep (2000)
  3692.     ControlSend($handle, "", "","4 ")
  3693.     Sleep (2000)
  3694.     $buff4flag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3695.     Sleep(25)
  3696.     ControlSend($handle, "", "","{F1} ")
  3697.        EndIf
  3698.      Endif
  3699.   EndIf
  3700. EndFunc
  3701.  
  3702. ;********** Functions: Auto Repair **********
  3703.  
  3704. Func check4Repair()
  3705.   CheckIfPause()
  3706.   If GUICtrlRead($checkSkill) = 1 then
  3707.      If GUICtrlRead($F2Skill9) = 1 then
  3708.        If _GetValue($minimumdamagerate) < Number(GUICtrlRead($F2Skill9Delay)) then
  3709.     ControlSend($handle, "", "","{F2} ")
  3710.     Call ("FindTarget2")
  3711.     Sleep (2000)
  3712.     ControlSend($handle, "", "","9 ")
  3713.     $buffrepairflag = _DateDiff( 's',"1970/01/01 00:00:00",_NowCalc())
  3714.     Sleep(25)
  3715.     ControlSend($handle, "", "","{F1} ")
  3716.        EndIf
  3717.        ;Msgbox(0,"Info",String(_GetValue($minimumdamagerate)));
  3718.      Endif
  3719.   EndIf
  3720. EndFunc
  3721.  
  3722.  
  3723. Func Click_Name () ; ensures command are not sent to chat window
  3724.  
  3725. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3726. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3727. ClickInControl("left",GUICtrlRead($wintitle),"","",520,430)
  3728.  
  3729. EndFunc
  3730.  
  3731. Func Click_Dialog ()
  3732.  
  3733. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3734. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3735. ClickInControl("left",GUICtrlRead($wintitle),"","",400,400)
  3736.  
  3737. EndFunc
  3738.  
  3739.  
  3740. Func Heal_30()
  3741.  
  3742. If GUICtrlRead($F1Skill7) = 1 then
  3743.  
  3744. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3745. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3746.  
  3747. Do
  3748.    $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  3749.    $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  3750.    $a = $curHP / $maxHP
  3751.    ;MsgBox(0,"Info", "curHP = "&String($curHP)& @CRLF &"$maxHP = "&String($maxHP))
  3752.    If $a <= (Number(GUICtrlRead($F1Skill7percent)) / 100) And ($curHP <> 0) then
  3753.     ControlSend($handle, "", "","7 ")
  3754.     Sleep (100)
  3755.     Call ("findtarget2")
  3756.     If GUICtrlRead($F1Skill8) = 1 then
  3757.         $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  3758.         $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  3759.         $a = $curHP / $maxHP
  3760.         If $a <= (Number(GUICtrlRead($F1Skill8percent)) / 100) then
  3761.             ControlSend($handle, "", "","{F1}")
  3762.             Sleep (10)
  3763.             ControlSend($handle, "", "","8 ")
  3764.             Sleep (Number(GUICtrlRead($F1Skill8Delay)))
  3765.         EndIf
  3766.     EndIf
  3767.     Sleep (Number(GUICtrlRead($F1Skill7Delay)))
  3768.    ElseIf $curHP = 0 then
  3769.         Call ("AutoSilf")
  3770.    EndIf
  3771. Until $a >= (Number(GUICtrlRead($F1Skill7percent)) / 100) Or $curHP = 0
  3772.  
  3773. EndIf
  3774.  
  3775. EndFunc
  3776.  
  3777. Func Heal_Pots()
  3778.  
  3779. If GUICtrlRead($F1Skill8) = 1 then
  3780. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3781. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3782. $hpflag = 0
  3783. Do
  3784.    $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  3785.    $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  3786.    $a = $curHP / $maxHP
  3787.    ;MsgBox(0,"Info", "curHP = "&String($curHP)& @CRLF &"$maxHP = "&String($maxHP))
  3788.  
  3789. If $curHP = 0 then
  3790.     $hpflag = 1
  3791.     Call ("AutoSilf")
  3792.         ;MsgBox(0,"Info", "autosilf")
  3793. Else
  3794.    If $a <= (Number(GUICtrlRead($F1Skill8percent)) / 100) then
  3795.     ;MsgBox(0,"Info", "curHP = "&String($curHP)& @CRLF &"$maxHP = "&String($maxHP))
  3796.     ControlSend($handle, "", "","{F1}")
  3797.     Sleep (10)
  3798.     ControlSend($handle, "", "","8 ")
  3799.     Sleep (Number(GUICtrlRead($F1Skill8Delay)))
  3800.     If $curHP = _GetData($baseAddressCharacter,$myCurHPoffset) Then
  3801.         ;MsgBox(0,"Info", "hpflag set to 1")
  3802.         $hpflag = 1
  3803.         GUICtrlSetState($F1Skill8, 4)
  3804.     Endif
  3805.    EndIf
  3806.  
  3807. EndIf
  3808.  
  3809. Until $a >= (Number(GUICtrlRead($F1Skill8percent)) / 100) Or $curHP = 0 Or $hpflag = 1
  3810.  
  3811. EndIf
  3812.  
  3813. EndFunc
  3814.  
  3815. Func TP_Pots()
  3816.  
  3817. If GUICtrlRead($F1Skill9) = 1 then
  3818.  
  3819. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3820. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3821. $tpflag = 0
  3822. Do
  3823.    $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  3824.    $TPCur = _GetData($baseAddressTargetMonster,$TPCurAddrOffset)
  3825.    $TPMax = _GetData($baseAddressTargetMonster,$TPMaxAddrOffset)
  3826.    $a = $TPCur / $TPMax
  3827.    ;MsgBox(0,"Info", "curHP = "&String($curHP)& @CRLF &"$maxHP = "&String($maxHP))
  3828.    If $a <= (Number(GUICtrlRead($F1Skill9percent)) / 100) then
  3829.     If $curHP <> 0 then
  3830.         ControlSend($handle, "", "","{F1}")
  3831.         Sleep (10)
  3832.         ControlSend($handle, "", "","9 ")
  3833.         Sleep (Number(GUICtrlRead($F1Skill9Delay)))
  3834.         If $TPCur = _GetData($baseAddressTargetMonster,$TPCurAddrOffset) Then
  3835.             $tpflag = 1
  3836.             GUICtrlSetState($F1Skill9, 4)
  3837.         Endif
  3838.     ElseIf $curHP = 0 then
  3839.         $tpflag = 1
  3840.         Call ("AutoSilf")
  3841.     EndIf
  3842.    EndIf
  3843. Until ($a >= (Number(GUICtrlRead($F1Skill9percent)) / 100)) Or $curHP = 0 Or $tpflag = 1
  3844.  
  3845. EndIf
  3846.  
  3847. EndFunc
  3848.  
  3849. Func _GetData($Address,$myOffset)
  3850.  
  3851. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3852. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3853.    $a = _GetValue($Address)
  3854.    $a = $a + $myOffset
  3855.    $myHP = _GetValue($a)
  3856.    Return $myHP
  3857.  
  3858. EndFunc
  3859.  
  3860. Func _GetAddressOffset($Address,$myOffset)
  3861. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3862. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3863.  
  3864.  
  3865.    $a = _GetValue($Address)
  3866.    $a = $a + $myOffset
  3867.    Return $a
  3868.  
  3869. EndFunc
  3870.  
  3871.  
  3872. Func _GetValue($Address)
  3873. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3874. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3875. ;Msgbox(0,"info","handle = "&$handle & @CRLF & "PID = " & $PID)
  3876.     $OpenProcess = _MemOpen(0x38, False, $PID) ;-> Enable reading/writing to the process and get the handle
  3877.  
  3878.     $byte1 = _MemRead($OpenProcess, $Address, 1) ;-> Read a 1 byte value from the defined address
  3879.     $Address = $Address + 1
  3880.     $byte2 = _MemRead($OpenProcess, $Address, 1) ;-> Read a 1 byte value from the defined address
  3881.     $Address = $Address + 1
  3882.     $byte3 = _MemRead($OpenProcess, $Address, 1) ;-> Read a 1 byte value from the defined address
  3883.     $Address = $Address + 1
  3884.     $byte4 = _MemRead($OpenProcess, $Address, 1) ;-> Read a 1 byte value from the defined address
  3885.  
  3886.  
  3887.     $Value = Hex($byte4, 2)&Hex($byte3, 2)&Hex($byte2, 2)&Hex($byte1, 2)
  3888.     $myInt = Dec($Value)
  3889.  
  3890.  
  3891.     _MemClose($OpenProcess) ;-> Disable reading/writing to the process
  3892.  
  3893.     Return $myInt
  3894.  
  3895. EndFunc
  3896.  
  3897. Func _writeValue($Address, $value1)
  3898. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3899. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3900.     $OpenProcess = _MemOpen(0x38, False, $PID) ;-> Enable reading/writing to the process and get the handle
  3901.  
  3902.     $byte1 = _MemWrite($OpenProcess, $Address, $Value1, 1) ;-> Read a 1 byte value from the defined address
  3903.     ;$Value = Hex($byte4, 2)&Hex($byte3, 2)&Hex($byte2, 2)&Hex($byte1, 2)
  3904.     ;$myInt = Dec($Value)
  3905.  
  3906.  
  3907.     _MemClose($OpenProcess) ;-> Disable reading/writing to the process
  3908.  
  3909.     ;Return $myInt
  3910.  
  3911. EndFunc
  3912.  
  3913.  
  3914. Func _GetMonsterName($baseAddressTargetMonster)
  3915.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  3916.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  3917.    $Address = _GetValue($baseAddressTargetMonster)
  3918.    $text = _readText($Address)
  3919.    Return $text
  3920.  
  3921. EndFunc
  3922.  
  3923. Func _GetDialogData($Address)
  3924.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  3925.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  3926.    $text = _readText($Address)
  3927.    Return $text
  3928.  
  3929. EndFunc
  3930.  
  3931. Func _GetTextData($Address)
  3932.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  3933.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  3934.    $text = _readText2($Address)
  3935.    Return $text
  3936.  
  3937. EndFunc
  3938.  
  3939.  
  3940. Func _readText($Address)
  3941.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  3942.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  3943.    $b = ""
  3944.    Do
  3945.     $a = _GetAscii($Address);
  3946.     $Address1 = $Address + 1
  3947.     $a1 = _GetAscii($Address1);
  3948.         ;MsgBox(0,"Info", "a is "&Hex($a,2)&" b is "&Hex($b,2))
  3949.     If Chr($a) = "[" or (Hex($a,2) = "00" And Hex($a1,2) = "00") then
  3950.        $b =$b
  3951.     Else
  3952.            $b = $b & Chr($a)
  3953.     EndIf
  3954.     $Address = $Address + 1
  3955.     ;MsgBox(0,"Info", "a is "&$a&" a1 is "&$a1)
  3956.  
  3957.    Until Chr($a) = "[" or (Hex($a,2) = "00" And Hex($a1,2) = "00")
  3958.    ;Until Chr($a) = "["
  3959.  
  3960.    Return $b
  3961.  
  3962. EndFunc
  3963.  
  3964. Func _readText2($Address)
  3965.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  3966.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  3967.    $b = ""
  3968.    Do
  3969.     $a = _GetAscii($Address);
  3970.     $Address1 = $Address + 1
  3971.     $a1 = _GetAscii($Address1);
  3972.         ;MsgBox(0,"Info", "a is "&Hex($a,2)&" b is "&Hex($b,2))
  3973.     If Not (Hex($a,2) = "00" And Hex($a1,2) = "00") then
  3974.            $b = $b & Chr($a)
  3975.     EndIf
  3976.     $Address = $Address + 1
  3977.     ;MsgBox(0,"Info", "a is "&$a&" a1 is "&$a1)
  3978.  
  3979.    Until (Hex($a,2) = "00" And Hex($a1,2) = "00")
  3980.  
  3981.  
  3982.    Return $b
  3983.  
  3984. EndFunc
  3985.  
  3986.  
  3987.  
  3988.  
  3989. Func _GetAscii($baseAddressCharacter)
  3990.  
  3991. $handle = WinGetHandle(GUICtrlRead($wintitle))
  3992. $PID = WinGetProcess(GUICtrlRead($wintitle))
  3993.     $Address = $baseAddressCharacter
  3994.     $OpenProcess = _MemOpen(0x38, False, $PID) ;-> Enable reading/writing to the process and get the handle
  3995.  
  3996.     $byte1 = _MemRead($OpenProcess, $Address, 1) ;-> Read a 1 byte value from the defined address
  3997.     _MemClose($OpenProcess) ;-> Disable reading/writing to the process
  3998.     Return $byte1
  3999.  
  4000. EndFunc
  4001.  
  4002. Func CheckPartyDialog()
  4003.    CheckIfPause()
  4004.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4005.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  4006.     If GUICtrlRead($partyOK) = 1 then
  4007.         If $dialogParty <> _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset)) then
  4008.             Call("Click_Dialog")
  4009.             ControlSend($handle, "", "","{ENTER}")
  4010.             Sleep (500)
  4011.             ControlSend($handle, "", "","{ENTER}")
  4012.             Sleep (500)
  4013.             ControlSend($handle, "", "","/g "&GUICtrlRead($partyjoinedreply))
  4014.             Sleep (500)
  4015.             ControlSend($handle, "", "","{ENTER}")
  4016.             _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  4017.                         $dialogParty = _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset))
  4018.         EndIf
  4019.     Else
  4020.         If $dialogParty <> _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset)) then
  4021.             Call("Click_Dialog")
  4022.             ClickInControl("left",GUICtrlRead($wintitle),"","",600,420)
  4023.             Sleep (500)
  4024.             ControlSend($handle, "", "","{ENTER}")
  4025.             Sleep (500)
  4026.             ControlSend($handle, "", "","/s "&GUICtrlRead($partydeniedreply))
  4027.             Sleep (500)
  4028.             ControlSend($handle, "", "","{ENTER}")
  4029.             _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  4030.                         $dialogParty = _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset))
  4031.         EndIf
  4032.  
  4033.     EndIf
  4034.  
  4035. EndFunc
  4036.  
  4037. Func CheckTradeRequestDialog()
  4038.    CheckIfPause()
  4039.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4040.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  4041.     If GUICtrlRead($canceltraderequest) = 1 then
  4042.         If $dialogTradeRequest <> _GetDialogData(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset)) then
  4043.             Call("Click_Dialog")
  4044.             ClickInControl("left",GUICtrlRead($wintitle),"","",600,420)
  4045.             Sleep (500)
  4046.             ControlSend($handle, "", "","{ENTER}")
  4047.             Sleep (500)
  4048.             ControlSend($handle, "", "","{ENTER}")
  4049.             Sleep (500)
  4050.             ControlSend($handle, "", "","/s "&GUICtrlRead($canceltraderequestreply))
  4051.             Sleep (500)
  4052.             ControlSend($handle, "", "","{ENTER}")
  4053.             _writeValue(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset), 49)
  4054.                         $dialogTradeRequest = _GetDialogData(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset))
  4055.         EndIf
  4056.     EndIf
  4057. EndFunc
  4058.  
  4059. Func CheckDuelRequestDialog()
  4060.    CheckIfPause()
  4061.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4062.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  4063.     If GUICtrlRead($canceltraderequest) = 1 then
  4064.         If $dialogDuelRequest <> _GetDialogData($baseAddressDialogDuel) then
  4065.             Call("Click_Dialog")
  4066.             ClickInControl("left",GUICtrlRead($wintitle),"","",600,420) ;599/424
  4067.             Sleep (500)
  4068.             Call("Click_Dialog")
  4069.             ControlSend($handle, "", "","{ENTER}")
  4070.             Sleep (500)
  4071.             ControlSend($handle, "", "","{ENTER}")
  4072.             Sleep (500)
  4073.             ControlSend($handle, "", "","{ENTER}")
  4074.             Sleep (500)
  4075.             ControlSend($handle, "", "","/s "&GUICtrlRead($canceltraderequestreply))
  4076.             Sleep (500)
  4077.             ControlSend($handle, "", "","{ENTER}")
  4078.             _writeValue($baseAddressDialogDuel, 49)
  4079.                         $dialogDuelRequest = _GetDialogData($baseAddressDialogDuel)
  4080.         EndIf
  4081.     EndIf
  4082. EndFunc
  4083.  
  4084. Func _replyToPM ()
  4085.  
  4086. CheckIfPause()
  4087.  
  4088.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4089.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  4090. ;Msgbox(0,"info","test")
  4091. ;Msgbox(0,"info2",_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbaseOffset)))
  4092. ;Msgbox(0,"info",GUICtrlRead($checkReplyText))
  4093. ;Msgbox(0,"compare result",String(StringInStr(_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbaseOffset)), "From")))
  4094. If GUICtrlRead($checkReplyPM) = 1 then
  4095. If StringInStr(_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbaseOffset)), "From") >= 1 then
  4096.      Call ("Click_Name")
  4097.      ControlSend($handle, "", "","v ")
  4098.      Sleep (50)
  4099.      ;Msgbox(0,"info",GUICtrlRead($checkReplyText))
  4100.      ControlSend($handle, "", "",GUICtrlRead($checkReplyText))
  4101.      Sleep (500)
  4102.      ControlSend($handle, "", "","{ENTER}")
  4103.      Call ("Click_Name")
  4104. ;Else
  4105. ;     Msgbox(0,"info","From not found")
  4106. EndIf
  4107. EndIf
  4108. EndFunc
  4109.  
  4110. Func AutoSilf()
  4111.  
  4112. CheckIfPause()
  4113.  
  4114. If GUICtrlRead($autosilf) = 1 then
  4115.    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4116.    $PID = WinGetProcess(GUICtrlRead($wintitle))
  4117.     $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  4118.     If $curHP = 0 then
  4119.         ClickInControl("left",GUICtrlRead($wintitle),"","",Number(GUICtrlRead($autosilfxcoord)),Number(GUICtrlRead($autosilfycoord)))
  4120.         Sleep (500)
  4121.         ClickInControl("left",GUICtrlRead($wintitle),"","",515,370)
  4122.         Sleep (500)
  4123.         Call ("Heal_30")
  4124.         Call ("Heal_Pots")
  4125.         Call ("TP_Pots")
  4126.     EndIf
  4127. EndIf
  4128.  
  4129. EndFunc
  4130.  
  4131. Func GetPos()
  4132.     $pos = MouseGetPos()
  4133.     GUIctrlSetData($autosilfxcoord,$pos[0])
  4134.     GUIctrlSetData($autosilfycoord,$pos[1])
  4135. EndFunc
  4136.  
  4137. Func MenuLaunch()
  4138.  
  4139. GUISwitch($autologinmenu)
  4140. GUISetState (@SW_HIDE)
  4141. GUISwitch($teleportgui)
  4142. GUISetState (@SW_HIDE)
  4143. GUISwitch($botmenu)
  4144. GUISetState (@SW_SHOW)
  4145.  
  4146.  
  4147. Do
  4148.         $handle = WinGetHandle(GUICtrlRead($wintitle))
  4149.         $PID = WinGetProcess(GUICtrlRead($wintitle))
  4150.     $msg = GUIGetMsg()
  4151.     If $msg = $viewstatusitem Then
  4152.         If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then
  4153.             GUICtrlSetState($viewstatusitem,$GUI_UNCHECKED)
  4154.             GUICtrlSetState($statuslabel,$GUI_HIDE)
  4155.         Else
  4156.             GUICtrlSetState($viewstatusitem,$GUI_CHECKED)
  4157.             GUICtrlSetState($statuslabel,$GUI_SHOW)
  4158.         EndIf
  4159.     EndIf
  4160.  
  4161.     If $msg = $StartBot then Auto_5()
  4162.     If $msg = $infoabout then MyAbout()
  4163.     If $msg = $menumain then MenuLaunch()
  4164.     If $msg = $saveitem then SaveConfig()
  4165.     If $msg = $fileitem then OpenConfig()
  4166.     If $msg = $menuteleport then MandaraTeleportHack()
  4167.     If $msg = $menuautologin then AutoLoginMenu()
  4168.         If $msg = $exititem then Exit
  4169.     if $msg = $partyOK then
  4170.         If GUICtrlRead($partyOK) = 1 Then
  4171.             GUICtrlSetState($partyjoinedreply, $GUI_ENABLE)
  4172.             GUICtrlSetState($partydeniedreply, $GUI_DISABLE)
  4173.         Else
  4174.             GUICtrlSetState($partyjoinedreply, $GUI_DISABLE)
  4175.             GUICtrlSetState($partydeniedreply, $GUI_ENABLE)
  4176.         EndIf
  4177.     endif
  4178.  
  4179.     if $msg = $antistuckup then
  4180.         If GUICtrlRead($antistuckup) = 1 Then
  4181.             GUICtrlSetState($antistuckspin, $GUI_ENABLE)
  4182.             GUICtrlSetState($antistuckmove, $GUI_ENABLE)
  4183.         Else
  4184.             GUICtrlSetState($antistuckspin, $GUI_DISABLE)
  4185.             GUICtrlSetState($antistuckmove, $GUI_DISABLE)
  4186.         EndIf
  4187.     endif
  4188.  
  4189.     if $msg = $DelayAfterFindTargetCheckBox then
  4190.         If GUICtrlRead($DelayAfterFindTargetCheckBox) = 1 Then
  4191.             GUICtrlSetState($DelayAfterFindTargetDelay, $GUI_ENABLE)
  4192.         Else
  4193.             GUICtrlSetState($DelayAfterFindTargetDelay, $GUI_DISABLE)
  4194.         EndIf
  4195.     endif
  4196.  
  4197.  
  4198.     if $msg = $F1Skill1 then
  4199.         If GUICtrlRead($F1Skill1) = 1 Then
  4200.             GUICtrlSetState($F1Skill1Delay, $GUI_ENABLE)
  4201.         Else
  4202.             GUICtrlSetState($F1Skill1Delay, $GUI_DISABLE)
  4203.         EndIf
  4204.     endif
  4205.  
  4206.     if $msg = $checkboxautologin then
  4207.         If GUICtrlRead($checkboxautologin) = 1 Then
  4208.             MsgBox(0,"Reminders","Ensure to set your username, password, and proper coordinates.")
  4209.             Send("+!a")
  4210.         Else
  4211.  
  4212.         EndIf
  4213.     endif
  4214.  
  4215.  
  4216.  
  4217.  
  4218.     if $msg = $F1Skill2 then
  4219.         If GUICtrlRead($F1Skill2) = 1 Then
  4220.             GUICtrlSetState($F1Skill2Delay, $GUI_ENABLE)
  4221.         Else
  4222.             GUICtrlSetState($F1Skill2Delay, $GUI_DISABLE)
  4223.         EndIf
  4224.     endif
  4225.  
  4226.     if $msg = $F1Skill3 then
  4227.         If GUICtrlRead($F1Skill3) = 1 Then
  4228.             GUICtrlSetState($F1Skill3Delay, $GUI_ENABLE)
  4229.         Else
  4230.             GUICtrlSetState($F1Skill3Delay, $GUI_DISABLE)
  4231.         EndIf
  4232.     endif
  4233.  
  4234.     if $msg = $F1Skill4 then
  4235.         If GUICtrlRead($F1Skill4) = 1 Then
  4236.             GUICtrlSetState($F1Skill4Delay, $GUI_ENABLE)
  4237.         Else
  4238.             GUICtrlSetState($F1Skill4Delay, $GUI_DISABLE)
  4239.         EndIf
  4240.     endif
  4241.  
  4242.     if $msg = $F1Skill7 then
  4243.         If GUICtrlRead($F1Skill7) = 1 Then
  4244.             GUICtrlSetState($F1Skill7Delay, $GUI_ENABLE)
  4245.             GUICtrlSetState($F1Skill7percent, $GUI_ENABLE)
  4246.         Else
  4247.             GUICtrlSetState($F1Skill7Delay, $GUI_DISABLE)
  4248.             GUICtrlSetState($F1Skill7percent, $GUI_DISABLE)
  4249.         EndIf
  4250.     endif
  4251.  
  4252.     if $msg = $F1Skill8 then
  4253.         If GUICtrlRead($F1Skill8) = 1 Then
  4254.             GUICtrlSetState($F1Skill8Delay, $GUI_ENABLE)
  4255.             GUICtrlSetState($F1Skill8percent, $GUI_ENABLE)
  4256.         Else
  4257.             GUICtrlSetState($F1Skill8Delay, $GUI_DISABLE)
  4258.             GUICtrlSetState($F1Skill8percent, $GUI_DISABLE)
  4259.         EndIf
  4260.     endif
  4261.  
  4262.     if $msg = $F1Skill9 then
  4263.         If GUICtrlRead($F1Skill9) = 1 Then
  4264.             GUICtrlSetState($F1Skill9Delay, $GUI_ENABLE)
  4265.             GUICtrlSetState($F1Skill9percent, $GUI_ENABLE)
  4266.         Else
  4267.             GUICtrlSetState($F1Skill9Delay, $GUI_DISABLE)
  4268.             GUICtrlSetState($F1Skill9percent, $GUI_DISABLE)
  4269.         EndIf
  4270.     endif
  4271.  
  4272.     if $msg = $F2Skill1 then
  4273.         If GUICtrlRead($F2Skill1) = 1 Then
  4274.             GUICtrlSetState($F2Skill1Delay, $GUI_ENABLE)
  4275.         Else
  4276.             GUICtrlSetState($F2Skill1Delay, $GUI_DISABLE)
  4277.         EndIf
  4278.     endif
  4279.  
  4280.     if $msg = $F2Skill2 then
  4281.         If GUICtrlRead($F2Skill2) = 1 Then
  4282.             GUICtrlSetState($F2Skill2Delay, $GUI_ENABLE)
  4283.         Else
  4284.             GUICtrlSetState($F2Skill2Delay, $GUI_DISABLE)
  4285.         EndIf
  4286.     endif
  4287.  
  4288.     if $msg = $F2Skill3 then
  4289.         If GUICtrlRead($F2Skill3) = 1 Then
  4290.             GUICtrlSetState($F2Skill3Delay, $GUI_ENABLE)
  4291.         Else
  4292.             GUICtrlSetState($F2Skill3Delay, $GUI_DISABLE)
  4293.         EndIf
  4294.     endif
  4295.  
  4296.     if $msg = $F2Skill4 then
  4297.         If GUICtrlRead($F2Skill4) = 1 Then
  4298.             GUICtrlSetState($F2Skill4Delay, $GUI_ENABLE)
  4299.         Else
  4300.             GUICtrlSetState($F2Skill4Delay, $GUI_DISABLE)
  4301.         EndIf
  4302.     endif
  4303.  
  4304.     if $msg = $F2Skill7 then
  4305.         If GUICtrlRead($F2Skill7) = 1 Then
  4306.             GUICtrlSetState($F2Skill7Delay, $GUI_ENABLE)
  4307.         Else
  4308.             GUICtrlSetState($F2Skill7Delay, $GUI_DISABLE)
  4309.         EndIf
  4310.     endif
  4311.  
  4312.     if $msg = $F2Skill9 then
  4313.         If GUICtrlRead($F2Skill9) = 1 Then
  4314.             GUICtrlSetState($F2Skill9Delay, $GUI_ENABLE)
  4315.         Else
  4316.             GUICtrlSetState($F2Skill9Delay, $GUI_DISABLE)
  4317.         EndIf
  4318.     endif
  4319.  
  4320.     if $msg = $F2Skill6 then
  4321.         If GUICtrlRead($F2Skill6) = 1 Then
  4322.             GUICtrlSetState($F2Skill6Delay, $GUI_ENABLE)
  4323.         Else
  4324.             GUICtrlSetState($F2Skill6Delay, $GUI_DISABLE)
  4325.         EndIf
  4326.     endif
  4327.  
  4328.         if $msg = $checkSkill then
  4329.         If GUICtrlRead($checkSkill) = 1 Then
  4330.             GUICtrlSetState($F1Skill1Delay, $GUI_ENABLE)
  4331.             GUICtrlSetState($F1Skill1, 1)
  4332.             GUICtrlSetState($F1Skill2Delay, $GUI_ENABLE)
  4333.             GUICtrlSetState($F1Skill2, 1)
  4334.             GUICtrlSetState($F1Skill3Delay, $GUI_ENABLE)
  4335.             GUICtrlSetState($F1Skill3, 1)
  4336.             GUICtrlSetState($F1Skill4Delay, $GUI_ENABLE)
  4337.             GUICtrlSetState($F1Skill4, 1)
  4338.  
  4339.             GUICtrlSetState($F1Skill1, $GUI_ENABLE)
  4340.             GUICtrlSetState($F1Skill1, 1)
  4341.             GUICtrlSetState($F1Skill2, $GUI_ENABLE)
  4342.             GUICtrlSetState($F1Skill2, 1)
  4343.             GUICtrlSetState($F1Skill3, $GUI_ENABLE)
  4344.             GUICtrlSetState($F1Skill3, 1)
  4345.             GUICtrlSetState($F1Skill4, $GUI_ENABLE)
  4346.             GUICtrlSetState($F1Skill4, 1)
  4347.  
  4348.  
  4349.         Else
  4350.             GUICtrlSetState($F1Skill1Delay, $GUI_DISABLE)
  4351.             GUICtrlSetState($F1Skill1, 4)
  4352.             GUICtrlSetState($F1Skill2Delay, $GUI_DISABLE)
  4353.             GUICtrlSetState($F1Skill2, 4)
  4354.             GUICtrlSetState($F1Skill3Delay, $GUI_DISABLE)
  4355.             GUICtrlSetState($F1Skill3, 4)
  4356.             GUICtrlSetState($F1Skill4Delay, $GUI_DISABLE)
  4357.             GUICtrlSetState($F1Skill4, 4)
  4358.  
  4359.  
  4360.             GUICtrlSetState($F1Skill1, $GUI_DISABLE)
  4361.             GUICtrlSetState($F1Skill1, 4)
  4362.             GUICtrlSetState($F1Skill2, $GUI_DISABLE)
  4363.             GUICtrlSetState($F1Skill2, 4)
  4364.             GUICtrlSetState($F1Skill3, $GUI_DISABLE)
  4365.             GUICtrlSetState($F1Skill3, 4)
  4366.             GUICtrlSetState($F1Skill4, $GUI_DISABLE)
  4367.             GUICtrlSetState($F1Skill4, 4)
  4368.  
  4369.  
  4370.         EndIf
  4371.         endif
  4372.  
  4373.  
  4374.     if $msg = $checkReplyPM then
  4375.         If GUICtrlRead($checkReplyPM) = 1 Then
  4376.             GUICtrlSetState($checkReplyText, $GUI_ENABLE)
  4377.         Else
  4378.             GUICtrlSetState($checkReplyText, $GUI_DISABLE)
  4379.         EndIf
  4380.     endif
  4381.  
  4382.  
  4383.         if $msg = $checkRepair then
  4384.         If GUICtrlRead($checkRepair) = 1 Then
  4385.             GUICtrlSetState($F2Skill9Delay, $GUI_ENABLE)
  4386.             GUICtrlSetState($F2Skill9, $GUI_ENABLE)
  4387.             GUICtrlSetState($F2Skill9, 1)
  4388.             Msgbox(0,"Auto Repair Note:","Set hammer to F2 slot 9 then set the MINIMUM DAMAGE RATE accordingly.")
  4389.         Else
  4390.             GUICtrlSetState($F2Skill9Delay, $GUI_DISABLE)
  4391.             GUICtrlSetState($F2Skill9, $GUI_DISABLE)
  4392.             GUICtrlSetState($F2Skill9, 4)
  4393.         EndIf
  4394.         endif
  4395.     if $msg = $checkLoot then
  4396.         If GUICtrlRead($checkLoot) = 1 Then
  4397.             GUICtrlSetState($lootduration, $GUI_ENABLE)
  4398.         Else
  4399.             GUICtrlSetState($lootduration, $GUI_DISABLE)
  4400.         EndIf
  4401.     endif
  4402.     if $msg = $checkMonsterSelectTarget then
  4403.         If GUICtrlRead($checkMonsterSelectTarget) = 1 Then
  4404.             $MonsterSelectTargetFlag = 1
  4405.             GUICtrlSetState($MonsterCombo, $GUI_ENABLE)
  4406.             GUICtrlSetState($ClearMonsterList, $GUI_ENABLE)
  4407.             GUICtrlSetState($AddMonsterList, $GUI_ENABLE)
  4408.         Else
  4409.             $MonsterSelectTargetFlag = 0
  4410.             GUICtrlSetState($MonsterCombo, $GUI_DISABLE)
  4411.             GUICtrlSetState($ClearMonsterList, $GUI_DISABLE)
  4412.             GUICtrlSetState($AddMonsterList, $GUI_DISABLE)
  4413.         EndIf
  4414.         ;msgbox(0,"MONSTER ", GUICtrlRead($checkMonsterSelectTarget))
  4415.     endif
  4416.     If $msg = $ClearMonsterList then
  4417.         GUICtrlSetData($MonsterCombo,"","") ; add other item snd set a new default
  4418.     EndIf
  4419.     If $msg = $AddMonsterList then
  4420.         ;msgbox(0,"MONSTER ", GUICtrlRead($MonsterCombo,1))
  4421.         ;Msgbox(0,"test: ",String(StringInStr(GUICtrlRead($MonsterCombo,1),"Kemsa Tonyo")))
  4422.  
  4423.             ;Msgbox(0, "dialog b4 ",_GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset)))
  4424.                 ;$v_Read = _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  4425.                 ;Msgbox(0, "dialogue data",_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbaseOffset)))
  4426.                 ;Msgbox(0, "dialogue data",_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbase2FirstLine)))
  4427.         ;Call ("check4Repair")
  4428.                 ;Msgbox(0, "dialogue data",_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbase2FirstLine)))
  4429.                 ;Msgbox(0, "dialogue data",_GetTextData(_GetAddressOffset($chatMsgAddrbase,$chatMsgAddrbase2ThirdLine)))
  4430.             ;Msgbox(0, "dialog after ",_GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset)))
  4431.         ;Msgbox(0, "dialogue data",_GetTextData(0x16A30410))
  4432.                 ;Call ("_replyToPM")
  4433.         GUICtrlSetData ($MonsterCombo, _GetMonsterName($baseAddressTargetMonster)&@CRLF,1)
  4434.     EndIf
  4435.  
  4436.     IF $msg = $EXITMAIN then
  4437.         Exit
  4438.     EndIf
  4439.  
  4440.     IF $msg = $GUI_EVENT_CLOSE then
  4441.         Exit
  4442.     EndIf
  4443.  
  4444.     if $msg = $canceltraderequest then
  4445.         If GUICtrlRead($canceltraderequest) = 1 Then
  4446.             GUICtrlSetState($canceltraderequestreply, $GUI_ENABLE)
  4447.         Else
  4448.             GUICtrlSetState($canceltraderequestreply, $GUI_DISABLE)
  4449.         EndIf
  4450.     endif
  4451.  
  4452.     if $msg = $autosilf then
  4453.         If GUICtrlRead($autosilf) = 1 Then
  4454.             GUICtrlSetState($autosilfxcoord, $GUI_ENABLE)
  4455.             GUICtrlSetState($autosilfycoord, $GUI_ENABLE)
  4456.             Msgbox(0,"How to use auto silfrijan a.k.a. SELF RESU","Set Silfrijan to F1 slot 10 and F2 slot 10, point the mouse to it then press F5 to set the correct X and Y coordinate. Then RUN the bot as usual.")
  4457.         Else
  4458.             GUICtrlSetState($autosilfxcoord, $GUI_DISABLE)
  4459.             GUICtrlSetState($autosilfycoord, $GUI_DISABLE)
  4460.         EndIf
  4461.     endif
  4462.  
  4463.  
  4464. Until $msg = $EXITMAIN Or $msg = $GUI_EVENT_CLOSE
  4465.  
  4466. GUISwitch($autologinmenu)
  4467. GUISetState (@SW_HIDE)
  4468. GUISwitch($botmenu)
  4469. GUISetState (@SW_HIDE)
  4470.  
  4471.  
  4472. EndFunc
  4473.  
  4474. Func AutoLoginMenu()
  4475.  
  4476.  
  4477. GUISwitch($botmenu)
  4478. GUISetState (@SW_HIDE)
  4479. GUISwitch($teleportgui)
  4480. GUISetState (@SW_HIDE)
  4481.  
  4482. GUISwitch($autologinmenu)
  4483. GUISetState (@SW_SHOW)
  4484.  
  4485. ; Run the GUI until the dialog is closed
  4486. While 1
  4487.  
  4488.     $msg = GUIGetMsg()
  4489.         If $msg = $infoabout2 then MyAbout()
  4490.     If $msg = $menumain2 then MenuLaunch()
  4491.     If $msg = $saveitem2 then SaveConfig()
  4492.     If $msg = $fileitem2 then OpenConfig()
  4493.     If $msg = $menuteleport2 then MandaraTeleportHack()
  4494.     If $msg = $menuautologin2 then AutoLoginMenu()
  4495.  
  4496.  
  4497.     If $msg = $LOGIN then
  4498.         If CheckConnection() = 0 then
  4499.         $handle = WinGetHandle(GUICtrlRead($wintitle))
  4500.         $PID = WinGetProcess(GUICtrlRead($wintitle))
  4501.             If $PID then
  4502.            ProcessClose($PID)
  4503.            ProcessWaitClose($PID)
  4504.                 EndIf
  4505.         Call ("Login")
  4506.             Call ("_getDialogQuestion")
  4507.             _OpenFileDialog()
  4508.         Else
  4509.         MsgBox(0,"Info", "Tantra seems to be running already."
  4510.         EndIf
  4511.     EndIf
  4512.  
  4513.     If $msg = $DIALOG then
  4514.         Call ("_getDialogQuestion")
  4515.         _OpenFileDialog()
  4516.  
  4517.         ;MsgBox(0,"Info", "Value returned is "&CheckInternetConnection())
  4518.     EndIf
  4519.  
  4520.     IF $msg = $BACK Or $msg = $GUI_EVENT_CLOSE then
  4521.                 GUISwitch($botmenu)
  4522.         Send("+!m")
  4523.     EndIf
  4524.  
  4525.     If $msg = $GUI_EVENT_CLOSE Then ExitLoop
  4526. Wend
  4527.  
  4528. EndFunc
  4529.  
  4530.  
  4531. Func _getDialogQuestion()
  4532.  
  4533. Do
  4534.  
  4535. $handle = WinGetHandle(GUICtrlRead($wintitle))
  4536. $PID = WinGetProcess(GUICtrlRead($wintitle))
  4537. ProcessWait($PID)
  4538.  
  4539. GUIctrlSetData($question,StringTrimRight(_readText2($questionAddress),1))
  4540. GUIctrlSetData($answerupperleft,StringTrimRight(_readText2($choiceupperleftAddress),1))
  4541. GUIctrlSetData($answerupperright,StringTrimRight(_readText2($choiceupperrightAddress),1))
  4542. GUIctrlSetData($answerlowerleft,StringTrimRight(_readText2($choicelowerleftAddress),1))
  4543. GUIctrlSetData($answerlowerright,StringTrimRight(_readText2($choicelowerrightAddress),1))
  4544.  
  4545. Until StringLen(_readText2($questionAddress)) >= 1 And StringLen(_readText2($choiceupperleftAddress)) >= 1 And StringLen(_readText2($choiceupperrightAddress)) >= 1 And StringLen(_readText2($choicelowerleftAddress)) >= 1 And StringLen(_readText2($choicelowerrightAddress)) >= 1
  4546.  
  4547.  
  4548. Sleep (Number(GUICtrlRead($delay6))) ;delay2
  4549.  
  4550.  
  4551. EndFunc
  4552.  
  4553. Func GetPosUpperLeft()
  4554.     $pos = MouseGetPos()
  4555.     GUIctrlSetData($upperleftX,$pos[0])
  4556.     GUIctrlSetData($upperleftY,$pos[1])
  4557. EndFunc
  4558.  
  4559. Func GetPosLowerLeft()
  4560.     $pos = MouseGetPos()
  4561.     GUIctrlSetData($lowerleftX,$pos[0])
  4562.     GUIctrlSetData($lowerleftY,$pos[1])
  4563. EndFunc
  4564.  
  4565. Func GetPosUpperRight()
  4566.     $pos = MouseGetPos()
  4567.     GUIctrlSetData($upperrightX,$pos[0])
  4568.     GUIctrlSetData($upperrightY,$pos[1])
  4569. EndFunc
  4570.  
  4571. Func GetPosLowerRight()
  4572.     $pos = MouseGetPos()
  4573.     GUIctrlSetData($lowerrightX,$pos[0])
  4574.     GUIctrlSetData($lowerrightY,$pos[1])
  4575. EndFunc
  4576.  
  4577.  
  4578. Func Login ()
  4579.  
  4580. If Not (GUICtrlRead($username) = "" Or GUICtrlRead($password) = "") then
  4581.  
  4582. $count2 = 0
  4583.  
  4584. FileChangeDir (GUICtrlRead($tantradir))
  4585. $Process = 'HTLauncher.exe'
  4586.  
  4587. GUICtrlSetData($statuslabel,"Auto-login started...")
  4588.  
  4589. $i_pid = Run(GUICtrlRead($tantradir)&"Tantra.exe")
  4590. ;$i_pid = Run(GUICtrlRead($tantradir)&$Process)
  4591.  
  4592. ProcessWait($i_pid)
  4593.  
  4594. $ProcessUpdate = 'Update.exe' ;-> Target process
  4595. ProcessWait($ProcessUpdate)
  4596. $PID = ProcessExists($ProcessUpdate) ;-> Get Process ID
  4597. Sleep (Number(GUICtrlRead($delay1))) ;delay1
  4598.  
  4599. Send("{ENTER}")
  4600. Sleep(500)
  4601.  
  4602. While WinExists("Update")
  4603.   Sleep(500)
  4604.   Send("{ENTER}")
  4605.   Sleep(500)
  4606.   Send("{ENTER}")
  4607. Wend
  4608.  
  4609. Sleep (Number(GUICtrlRead($delay2))) ;delay2
  4610.  
  4611. WinWait("Tantra Launcher")
  4612. WinSetTitle("Tantra Launcher", "", GUICtrlRead($wintitle))
  4613. $handle = WinGetHandle(GUICtrlRead($wintitle))
  4614.  
  4615. $PID = WinGetProcess(GUICtrlRead($wintitle))
  4616.  
  4617. ClickInControl("left",GUICtrlRead($wintitle),"","",520,440)
  4618.  
  4619. ControlSend($handle, "", "","{BS 15}")
  4620. ControlSend($handle, "", "","{DEL 15}")
  4621. ControlSend($handle, "", "",GUICtrlRead($username))
  4622. ControlSend($handle, "", "","{TAB}")
  4623. ControlSend($handle, "", "","{BS 15}")
  4624. ControlSend($handle, "", "","{DEL 15}")
  4625. ControlSend($handle, "", "",GUICtrlRead($password))
  4626. ControlSend($handle, "", "","{ENTER}")
  4627. Sleep (Number(GUICtrlRead($delay3))) ; delay3
  4628.  
  4629. Select
  4630.   Case GUICtrlRead($serverselect) = "Manas"
  4631.     $serverY = 260
  4632.   Case GUICtrlRead($serverselect) = "Diyana"
  4633.     $serverY = 295
  4634.   Case GUICtrlRead($serverselect) = "Manas"
  4635.     $serverY = 328
  4636.   Case GUICtrlRead($serverselect) = "Samadi"
  4637.     $serverY = 363
  4638.   Case GUICtrlRead($serverselect) = "Warzone"
  4639.     $serverY = 395
  4640. EndSelect
  4641.  
  4642. ClickInControl("left",GUICtrlRead($wintitle),"","",478,$serverY)
  4643. Sleep (50)
  4644. ClickInControl("left",GUICtrlRead($wintitle),"","",478,$serverY)
  4645. Sleep (500)
  4646. ClickInControl("left",GUICtrlRead($wintitle),"","",478,$serverY)
  4647. Sleep (500)
  4648. ClickInControl("left",GUICtrlRead($wintitle),"","",478,$serverY)
  4649.  
  4650. ControlSend($handle, "", "","{ENTER}")
  4651. Sleep (Number(GUICtrlRead($delay4))) ; delay4
  4652.  
  4653. Select
  4654.   Case GUICtrlRead($characterselect) = "Character1"
  4655.     $charX = 278
  4656.     $charY = 484
  4657.     $char2X = 172
  4658.     $char2Y = 428
  4659.   Case GUICtrlRead($characterselect) = "Character2"
  4660.     $charX = 514
  4661.     $charY = 463
  4662.     $char2X = 200
  4663.     $char2Y = 429
  4664.   Case GUICtrlRead($characterselect) = "Character3"
  4665.     $charX = 733
  4666.     $charY = 440
  4667.     $char2X = 645
  4668.     $char2Y = 429
  4669. EndSelect
  4670.  
  4671. ClickInControl("left",GUICtrlRead($wintitle),"","",$charX,$charY)
  4672. Sleep (500)
  4673. ClickInControl("left",GUICtrlRead($wintitle),"","",$charX,$charY)
  4674. Sleep (500)
  4675. ClickInControl("left",GUICtrlRead($wintitle),"","",$charX,$charY)
  4676. Sleep (500)
  4677.  
  4678. ControlSend($handle, "", "","{ENTER}")
  4679. Sleep (Number(GUICtrlRead($delay5))) ;delay5
  4680.  
  4681. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4682. Sleep (500)
  4683. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4684. Sleep (500)
  4685. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4686. Sleep (500)
  4687. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4688. Sleep (500)
  4689. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4690. Sleep (500)
  4691. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4692. Sleep (500)
  4693. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4694. Sleep (500)
  4695. ClickInControl("left",GUICtrlRead($wintitle),"","",$char2X,$char2Y)
  4696.  
  4697.  
  4698. Else
  4699.    MsgBox(0, "Warning", "Username and/or password field has no value.")
  4700.  
  4701. EndIf
  4702.  
  4703. EndFunc
  4704.  
  4705. Func _OpenFileDialog()
  4706.  
  4707. FileChangeDir ($currentdir)
  4708.  
  4709. If FileExists("dialog.txt") Then
  4710.  
  4711. $handle = WinGetHandle(GUICtrlRead($wintitle))
  4712. $PID = WinGetProcess(GUICtrlRead($wintitle))
  4713.         ;Msgbox(0,"Info", $currentdir)
  4714.  
  4715.     $file = FileOpen("dialog.txt", 0)
  4716.     ; Check if file opened for reading OK
  4717.     If $file = -1 Then
  4718.        MsgBox(0, "Error", "Unable to open file.")
  4719.        Exit
  4720.     EndIf
  4721.  
  4722.     ; Read in lines of text until the EOF is reached
  4723.     ;MsgBox(0, "Question:", GUICtrlRead($question))
  4724.     While 1
  4725.        $line = FileReadLine($file)
  4726.        If @error = -1 Then ExitLoop
  4727.  
  4728.        If StringInStr($line,GUICtrlRead($question)) >= 1 Then
  4729.            $ans = StringRight($line, StringLen($line) - StringInStr($line, ","))
  4730.            Select
  4731.            Case $ans = GUICtrlRead($answerupperleft)
  4732.             ;MsgBox(0, "location","upper left")
  4733.             $myX = Number(GUICtrlRead($upperleftX))
  4734.             $myY = Number(GUICtrlRead($upperleftY))
  4735.            Case $ans = GUICtrlRead($answerlowerleft)
  4736.             ;MsgBox(0, "location","lower left")
  4737.             $myX = Number(GUICtrlRead($lowerleftX))
  4738.             $myY = Number(GUICtrlRead($lowerleftY))
  4739.            Case $ans = GUICtrlRead($answerupperright)
  4740.             ;MsgBox(0, "location","upper right")
  4741.             $myX = Number(GUICtrlRead($upperrightX))
  4742.             $myY = Number(GUICtrlRead($upperrightY))
  4743.            Case $ans = GUICtrlRead($answerlowerright)
  4744.             ;MsgBox(0, "location","lower right")
  4745.             $myX = Number(GUICtrlRead($lowerrightX))
  4746.             $myY = Number(GUICtrlRead($lowerrightY))
  4747.            EndSelect
  4748.  
  4749.            ClickInControl("left",GUICtrlRead($wintitle),"","",$myX,$myY)
  4750.                    $handle = WinGetHandle(GUICtrlRead($wintitle))
  4751.                    ;GUICtrlSetData($wintitle, GUICtrlRead($wintitle))
  4752.            WinSetTitle($handle, "", GUICtrlRead($wintitle))
  4753.            GetCharacterStatus()
  4754.        EndIf
  4755.     Wend
  4756.     FileClose($file)
  4757. Else
  4758.     MsgBox(4096,"Warning", "dialog.txt file does not exist. Unable to continue")
  4759. EndIf
  4760.  
  4761. EndFunc
  4762.  
  4763. Func CheckConnection()
  4764.  
  4765. FileChangeDir ($currentdir)
  4766.  
  4767. RunWait(@ComSpec & " /c " & "netstat.exe -na -p TCP > ip.txt","",@SW_HIDE)
  4768. sleep(1000)
  4769.  
  4770. If FileExists("tantraip.txt") Then
  4771.         ;Msgbox(0,"Info", $currentdir)
  4772.  
  4773.     $file = FileOpen("tantraip.txt", 0)
  4774.     ; Check if file opened for reading OK
  4775.     If $file = -1 Then
  4776.        MsgBox(0, "Error", "Unable to open file.")
  4777.        Exit
  4778.     EndIf
  4779.  
  4780.     While 1
  4781.        $line = FileReadLine($file)
  4782.        If @error = -1 Then ExitLoop
  4783.            ;MsgBox(0, "TantraIP", $line)
  4784.        $fileip = FileOpen("ip.txt", 0)
  4785.        If $fileip = -1 Then
  4786.           MsgBox(0, "Error", "Unable to open ip.txt file.")
  4787.           Exit
  4788.        EndIf
  4789.        While 1
  4790.         $ipline = FileReadLine($fileip)
  4791.         If @error = -1 Then ExitLoop
  4792.                 If StringInStr($ipline,$line) > 1 then
  4793.           FileClose($fileip)
  4794.           FileClose($file)
  4795.           Return 1
  4796.         EndIf
  4797.        Wend
  4798.     Wend
  4799.         FileClose($fileip)
  4800.     FileClose($file)
  4801.  
  4802. Else
  4803.     MsgBox(4096,"Warning", "dialog.txt file does not exist. Unable to continue")
  4804. EndIf
  4805.  
  4806. Return 0
  4807.  
  4808. EndFunc
  4809.  
  4810. Func checkifdisconnected()
  4811.     CheckIfPause()
  4812.     If GUICtrlRead($checkboxautologin) = 1 Then
  4813.         If CheckConnection() = 0 Or Not WinExists(GUICtrlRead($wintitle)) then
  4814.                 ;If Not WinExists(GUICtrlRead($wintitle)) then
  4815.         ;   GUICtrlSetData($wintitle, "Tantra Launcher")
  4816.         ;EndIf
  4817.         $handle = WinGetHandle(GUICtrlRead($wintitle))
  4818.         $PID = WinGetProcess(GUICtrlRead($wintitle))
  4819.                 If $PID then
  4820.            ProcessClose($PID)
  4821.            ProcessWaitClose($PID)
  4822.                 EndIf
  4823.         $internectcheckcount = 1
  4824.         Do
  4825.           GUICtrlSetData($statuslabel,"Checking internet connection..."&String($internectcheckcount)&" sec/s")
  4826.           $internectcheckcount = $internectcheckcount + 1
  4827.           Sleep (1000)
  4828.         Until CheckInternetConnection() = 1
  4829.         GUICtrlSetData($statuslabel,"Checking internet connection..."&" OK")
  4830.                 Sleep(Number(GUICtrlRead($autologindelay)))
  4831.         Call ("Login")
  4832.             Call ("_getDialogQuestion")
  4833.             _OpenFileDialog()
  4834.         $count2 = 0
  4835.         _writeValue(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset), 49)
  4836.         $dialogTradeRequest = _GetDialogData(_GetAddressOffset($baseAddressDialogTrade,$TradeOffset))
  4837.         $maxHP = _GetData($baseAddressCharacter,$myMaxHPoffset)
  4838.         _writeValue(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset), 49)
  4839.         $dialogParty = _GetDialogData(_GetAddressOffset($baseAddressDialog,$invitedPartyOffset))
  4840.         EndIf
  4841.     EndIf
  4842. EndFunc
  4843.  
  4844. Func MandaraTeleportHack()
  4845.  
  4846.  
  4847. GUISwitch($autologinmenu)
  4848. GUISetState (@SW_HIDE)
  4849. GUISwitch($botmenu)
  4850. GUISetState (@SW_HIDE)
  4851. GUISwitch($teleportgui)
  4852. GUISetState (@SW_SHOW)
  4853.  
  4854. while 1
  4855.  
  4856. Do
  4857.     $handle = WinGetHandle(GUICtrlRead($wintitle))
  4858.     $PID = WinGetProcess(GUICtrlRead($wintitle))
  4859.     $msg = GUIGetMsg()
  4860.     If $msg = $infoabout3 then MyAbout()
  4861.     If $msg = $menumain3 then MenuLaunch()
  4862.     If $msg = $saveitem3 then SaveConfig()
  4863.     If $msg = $fileitem3 then OpenConfig()
  4864.     If $msg = $menuteleport3 then MandaraTeleportHack()
  4865.     If $msg = $menuautologin3 then AutoLoginMenu()
  4866.  
  4867.     $status1 = GUICtrlRead($APP1_ComboBOX)
  4868. If $status1 = "Mandara Village" Then $Value = '101'
  4869. If $status1 = "Mandara Portal" Then $Value = '103'
  4870. If $status1 = "Entrance to Mara Land" Then $Value = '104'
  4871. If $status1 = "Way to Coliseum" Then $Value = '105'
  4872. If $status1 = "Entrance to Shambala" Then $Value = '116'
  4873. If $status1 = "Anu Village" Then $Value = '117'
  4874. If $status1 = "Shambala Castle" Then $Value = '118'
  4875. If $status1 = "Holy Army's Barracks" Then $Value = '119'
  4876. If $status1 = "Town of Ruins" Then $Value = '120'
  4877. If $status1 = "Town of Ruins Westside Forest(1000)" Then $Value = '121'
  4878. If $status1 = "Horseman Town Well" Then $Value = '131'
  4879. If $status1 = "Horseman Dungeon 1st(600)" Then $Value = '124'
  4880. If $status1 = "Horseman Dungeon 1st end" Then $Value = '125'
  4881. If $status1 = "Horseman Dungeon 2nd(800)" Then $Value = '126'
  4882. If $status1 = "Shambala Dungeon" Then $Value = '123'
  4883. If $status1 = "Shambala Dungeon 1st(600)" Then $Value = '128'
  4884. If $status1 = "Shambala Dungeon 1st end" Then $Value = '129'
  4885. If $status1 = "Shambala Dungeon 2st(1000)" Then $Value = '130'
  4886. If $status1 = "Shambala Castle" Then $Value = '132'
  4887. If $status1 = "Jina Village Portal" Then $Value = '133'
  4888. If $status1 = "Rest Place(400)" Then $Value = '134'
  4889. If $status1 = "Country Borderline(400)" Then $Value = '135'
  4890. If $status1 = "Small Sea Port" Then $Value = '136'
  4891. If $status1 = "Pamir Plains(400)" Then $Value = '138'
  4892. If $status1 = "Mantra Temple" Then $Value = '140'
  4893. If $status1 = "Village of the Outcast" Then $Value = '141'
  4894. If $status1 = "Flower Field(400)" Then $Value = '142'
  4895. If $status1 = "Temple of Fire(400)" Then $Value = '143'
  4896. If $status1 = "Brahma Castle" Then $Value = '161'
  4897. If $status1 = "Vishnu Castle" Then $Value = '162'
  4898. If $status1 = "Shiva Castle" Then $Value = '163'
  4899. If $status1 = "Brahman Front Line" Then $Value = '164'
  4900. If $status1 = "Brahman Right Flank" Then $Value = '165'
  4901. If $status1 = "Brahman Left Flank" Then $Value = '166'
  4902. If $status1 = "Vishnite Front Line" Then $Value = '167'
  4903. If $status1 = "Vishnite Right Flank" Then $Value = '168'
  4904. If $status1 = "Vishnite Left Flank" Then $Value = '169'
  4905. If $status1 = "Shivan Front Line" Then $Value = '170'
  4906. If $status1 = "Shivan Right Flank" Then $Value = '171'
  4907. If $status1 = "Shivan Left Flank" Then $Value = '172'
  4908. If $status1 = "Brahman Chaturanga" Then $Value = '173'
  4909. If $status1 = "SHivan Chaturanga" Then $Value = '174'
  4910. If $status1 = "Vishnite Chaturanga" Then $Value = '175'
  4911. If $status1 = "Emperor's Tomb Entrance" Then $Value = '190'
  4912. If $status1 = "[Not Yet Implemented]" Then $Value = '191'
  4913. If $status1 = "West Tomb(20000)" Then $Value = '192'
  4914. If $status1 = "East Tomb(20000)" Then $Value = '193'
  4915. If $status1 = "Mahi Durga" Then $Value = '194'
  4916. If $status1 = "Ahb Durga" Then $Value = '195'
  4917. If $status1 = "Danva Durga" Then $Value = '196'
  4918. If $status1 = "Nar Durga" Then $Value = '197'
  4919. If $status1 = "Mahi Durga Gate" Then $Value = '198'
  4920. If $status1 = "Ahb Durga Gate" Then $Value = '199'
  4921. If $status1 = "Danva Durga Gate" Then $Value = '200'
  4922. If $status1 = "Nar Durga Gate" Then $Value = '201'
  4923. If $status1 = "Mahi Durga Stronghold" Then $Value = '202'
  4924. If $status1 = "Ahb Durga Stronghold" Then $Value = '203'
  4925. If $status1 = "Danva Durga Stronghold" Then $Value = '204'
  4926. If $status1 = "Nar Durga Stronghold" Then $Value = '205'
  4927. If $status1 = "Mahi Conference Hall" Then $Value = '206'
  4928. If $status1 = "Ahb Conference Hall" Then $Value = '207'
  4929. If $status1 = "Danva Conference Hall" Then $Value = '208'
  4930. If $status1 = "Nar Conference Hall" Then $Value = '209'
  4931. If $status1 = "Mahi Kaustbam" Then $Value = '216'
  4932. If $status1 = "Ahb Kaustbam" Then $Value = '217'
  4933. If $status1 = "Danva Kaustbam" Then $Value = '218'
  4934. If $status1 = "Nar Kaustbam" Then $Value = '219'
  4935. If $status1 = "Town Biryu" Then $Value = '220'
  4936. If $status1 = "Biryu Commercial Area" Then $Value = '221'
  4937. If $status1 = "Biryu Downtown Area" Then $Value = '222'
  4938. If $status1 = "[Not Yet Implemented]" Then $Value = '232'
  4939. If $status1 = "Mudha Dungeon[x]" Then $Value = '233'
  4940.     ;$status2 = GUICtrlRead($APP1_ComboBOX2)
  4941.     IF $msg = $RUN then _Teleport(Number($Value)) ;ReadAllPortals()
  4942.     IF $msg = $RUN2 then
  4943.         $v_Read = _searchMultiByte(Number(GUICtrlRead($searchStart)), GUICtrlRead($searchBytes), $searchlen, Number(GUICtrlRead($bytes2read)))
  4944.             If $v_Read <> 0 then
  4945.             Msgbox(0,"Info","Target address found: "&Hex($v_Read))
  4946.             GUICtrlSetData($inputAddress,$v_Read)
  4947.         Else
  4948.                 Msgbox(0,"Info","Target address NOT found." & @CRLF & @CRLF & "Possible causes:" & @CRLF & "1. You have used this program already to hack the target address." & @CRLF & "2. You have launched Tantra with modified parameters.")
  4949.         EndIf
  4950.     EndIf
  4951.  
  4952.     IF $msg = $BACK2 Or $msg = $GUI_EVENT_CLOSE then
  4953.         GUISwitch($teleportgui)
  4954.         GUISetState (@SW_HIDE)
  4955.                 GUISwitch($botmenu)
  4956.         GUISetState (@SW_SHOW)
  4957.         Send("+!m")
  4958.     EndIf
  4959.  
  4960.  
  4961. Until $msg = $EXIT
  4962.  
  4963. Wend
  4964.  
  4965. EndFunc
  4966.  
  4967.  
  4968. Func _Teleport($Value) ;
  4969.    If $Value <> 0 then
  4970.     $handle = WinGetHandle(GUICtrlRead($wintitle))
  4971.     $PID = WinGetProcess(GUICtrlRead($wintitle))
  4972.     $OpenProcess = _MemOpen(0x38, False, $PID) ;-> Enable reading/writing to the process and get the handle
  4973.         $v_Read = _MemWrite($OpenProcess, Number(GUICtrlRead($inputAddress)), $Value, 1);-> Write a new 1 byte value to the defined address
  4974.     _MemClose($OpenProcess) ;-> Disable reading/writing to the process
  4975.     MsgBox(0,"Info","Click Mandara portal now.")
  4976.    Else
  4977.     MsgBox(0,"Info","Target address is invalid.")
  4978.    EndIf
  4979. EndFunc
  4980.  
  4981.  
  4982. Func _searchMultiByte($Address, $searchBytes, $searchlen, $bytes2read)
  4983.  
  4984. $handle = WinGetHandle(GUICtrlRead($wintitle))
  4985. $PID = WinGetProcess(GUICtrlRead($wintitle))
  4986.  
  4987. Do
  4988.     GUICtrlSetData($currentaddress, $Address)
  4989.     $a1 = _GetBytesArray($Address, $bytes2read)
  4990.     ;$a1 = _MemRead($OpenProcess, $Address, $bytes2read) ;-> Read a 1 byte value from the defined address
  4991.     $result = StringInStr(Hex($a1), $searchBytes)
  4992.     $result = ($result - 1)/2
  4993.     $myAddress = $Address + $result
  4994.  
  4995.     $Address = $Address + $bytes2read - $searchlen
  4996.     ;$loop = $loop + 1
  4997.  
  4998.     If $result >= 0 then
  4999.     Return $myAddress
  5000.     EndIf
  5001.  
  5002. Until $Address >= Number(GUICtrlRead($searchEnd)) Or $result >= 0
  5003.  
  5004.     Return 0
  5005.  
  5006.  
  5007. EndFunc
  5008.  
  5009.  
  5010. Func _GetBytesArray($Address,$bytes)
  5011.  
  5012.     $handle = WinGetHandle(GUICtrlRead($wintitle))
  5013.     $PID = WinGetProcess(GUICtrlRead($wintitle))
  5014.     $OpenProcess = _MemOpen(0x38, False, $PID) ;-> Enable reading/writing to the process and get the handle
  5015.     $byte1 = _MemRead($OpenProcess, $Address, $bytes) ;-> Read a 1 byte value from the defined address
  5016.     _MemClose($OpenProcess) ;-> Disable reading/writing to the process
  5017.     Return $byte1
  5018. EndFunc
  5019.  
  5020. Func SaveConfig()
  5021.  
  5022. $configfile = FileSaveDialog( "Choose a name.", $currentdir, "booster101 (*.cfg)", 2)
  5023.  
  5024. If StringInStr($configfile,".cfg") >= 1 then
  5025.     $file = FileOpen($configfile, 2)
  5026. Else
  5027.     $file = FileOpen($configfile&".cfg", 2)
  5028. EndIf
  5029. If $file = -1 Then
  5030.   MsgBox(0, "Error", "Unable to open file.")
  5031.   Exit
  5032. EndIf
  5033.  
  5034. ;Msgbox(0,"info",$checkLoot)
  5035.  
  5036. FileWriteLine($file, $checkLoot&","&GUICtrlRead($checkLoot)&","&GUICtrlGetState($checkLoot)&",checkbox")
  5037. FileWriteLine($file, $lootduration&","&GUICtrlRead($lootduration)&","&GUICtrlGetState($lootduration)&",")
  5038. $text = StringReplace(GUICtrlRead($MonsterCombo), @CRLF, "-")
  5039. FileWriteLine($file, $MonsterCombo&","&$text&","&GUICtrlGetState($MonsterCombo)&",edit")
  5040. FileWriteLine($file, $checkMonsterSelectTarget&","&GUICtrlRead($checkMonsterSelectTarget)&","&GUICtrlGetState($checkMonsterSelectTarget)&",checkbox")
  5041. FileWriteLine($file, $ClearMonsterList&","&GUICtrlRead($ClearMonsterList)&","&GUICtrlGetState($ClearMonsterList)&",")
  5042. FileWriteLine($file, $AddMonsterList&","&GUICtrlRead($AddMonsterList)&","&GUICtrlGetState($AddMonsterList)&",")
  5043.  
  5044. FileWriteLine($file, $checkRepair&","&GUICtrlRead($checkRepair)&","&GUICtrlGetState($checkRepair)&",checkbox")
  5045. FileWriteLine($file, $checkSkill&","&GUICtrlRead($checkSkill)&","&GUICtrlGetState($checkSkill)&",checkbox")
  5046. FileWriteLine($file, $checkSkillR&","&GUICtrlRead($checkSkillR)&","&GUICtrlGetState($checkSkillR)&",checkbox")
  5047. FileWriteLine($file, $F1Skill1&","&GUICtrlRead($F1Skill1)&","&GUICtrlGetState($F1Skill1)&",checkbox")
  5048. FileWriteLine($file, $F1Skill1Delay&","&GUICtrlRead($F1Skill1Delay)&","&GUICtrlGetState($F1Skill1Delay)&",")
  5049. FileWriteLine($file, $F1Skill2&","&GUICtrlRead($F1Skill2)&","&GUICtrlGetState($F1Skill2)&",checkbox")
  5050. FileWriteLine($file, $F1Skill2Delay&","&GUICtrlRead($F1Skill2Delay)&","&GUICtrlGetState($F1Skill2Delay)&",")
  5051. FileWriteLine($file, $F1Skill3&","&GUICtrlRead($F1Skill3)&","&GUICtrlGetState($F1Skill3)&",checkbox")
  5052. FileWriteLine($file, $F1Skill3Delay&","&GUICtrlRead($F1Skill3Delay)&","&GUICtrlGetState($F1Skill3Delay)&",")
  5053. FileWriteLine($file, $F1Skill4&","&GUICtrlRead($F1Skill4)&","&GUICtrlGetState($F1Skill4)&",checkbox")
  5054. FileWriteLine($file, $F1Skill4Delay&","&GUICtrlRead($F1Skill4Delay)&","&GUICtrlGetState($F1Skill4Delay)&",")
  5055. FileWriteLine($file, $F1Skill7&","&GUICtrlRead($F1Skill7)&","&GUICtrlGetState($F1Skill7)&",checkbox")
  5056. FileWriteLine($file, $F1Skill7Delay&","&GUICtrlRead($F1Skill7Delay)&","&GUICtrlGetState($F1Skill7Delay)&",")
  5057. FileWriteLine($file, $F1Skill7percent&","&GUICtrlRead($F1Skill7percent)&","&GUICtrlGetState($F1Skill7percent)&",")
  5058. FileWriteLine($file, $F1Skill8&","&GUICtrlRead($F1Skill8)&","&GUICtrlGetState($F1Skill8)&",checkbox")
  5059. FileWriteLine($file, $F1Skill8Delay&","&GUICtrlRead($F1Skill8Delay)&","&GUICtrlGetState($F1Skill8Delay)&",")
  5060. FileWriteLine($file, $F1Skill8percent&","&GUICtrlRead($F1Skill8percent)&","&GUICtrlGetState($F1Skill8percent)&",")
  5061. FileWriteLine($file, $F1Skill9&","&GUICtrlRead($F1Skill9)&","&GUICtrlGetState($F1Skill9)&",checkbox")
  5062. FileWriteLine($file, $F1Skill9Delay&","&GUICtrlRead($F1Skill9Delay)&","&GUICtrlGetState($F1Skill9Delay)&",")
  5063. FileWriteLine($file, $F1Skill9percent&","&GUICtrlRead($F1Skill9percent)&","&GUICtrlGetState($F1Skill9percent)&",")
  5064. FileWriteLine($file, $DelayAfterFindTargetCheckBox&","&GUICtrlRead($DelayAfterFindTargetCheckBox)&","&GUICtrlGetState($DelayAfterFindTargetCheckBox)&",checkbox")
  5065. FileWriteLine($file, $DelayAfterFindTargetDelay&","&GUICtrlRead($DelayAfterFindTargetDelay)&","&GUICtrlGetState($DelayAfterFindTargetDelay)&",")
  5066. FileWriteLine($file, $checkReplyPM&","&GUICtrlRead($checkReplyPM)&","&GUICtrlGetState($checkReplyPM)&",checkbox")
  5067. FileWriteLine($file, $checkReplyText&","&GUICtrlRead($checkReplyText)&","&GUICtrlGetState($checkReplyText)&",")
  5068. FileWriteLine($file, $partyOK&","&GUICtrlRead($partyOK)&","&GUICtrlGetState($partyOK)&",checkbox")
  5069. FileWriteLine($file, $partyjoinedreply&","&GUICtrlRead($partyjoinedreply)&","&GUICtrlGetState($partyjoinedreply)&",")
  5070. FileWriteLine($file, $partydeniedreply&","&GUICtrlRead($partydeniedreply)&","&GUICtrlGetState($partydeniedreply)&",")
  5071. FileWriteLine($file, $canceltraderequest&","&GUICtrlRead($canceltraderequest)&","&GUICtrlGetState($canceltraderequest)&",checkbox")
  5072. FileWriteLine($file, $canceltraderequestreply&","&GUICtrlRead($canceltraderequestreply)&","&GUICtrlGetState($canceltraderequestreply)&",")
  5073. FileWriteLine($file, $checkboxautologin&","&GUICtrlRead($checkboxautologin)&","&GUICtrlGetState($checkboxautologin)&",checkbox")
  5074. FileWriteLine($file, $antistuckup&","&GUICtrlRead($antistuckup)&","&GUICtrlGetState($antistuckup)&",checkbox")
  5075. FileWriteLine($file, $antistuckspin&","&GUICtrlRead($antistuckspin)&","&GUICtrlGetState($antistuckspin)&",")
  5076. FileWriteLine($file, $antistuckmove&","&GUICtrlRead($antistuckmove)&","&GUICtrlGetState($antistuckmove)&",")
  5077. FileWriteLine($file, $autosilf&","&GUICtrlRead($autosilf)&","&GUICtrlGetState($autosilf)&",checkbox")
  5078. FileWriteLine($file, $autosilfxcoord&","&GUICtrlRead($autosilfxcoord)&","&GUICtrlGetState($autosilfxcoord)&",")
  5079. FileWriteLine($file, $autosilfycoord&","&GUICtrlRead($autosilfycoord)&","&GUICtrlGetState($autosilfycoord)&",")
  5080. FileWriteLine($file, $F2Skill1&","&GUICtrlRead($F2Skill1)&","&GUICtrlGetState($F2Skill1)&",checkbox")
  5081. FileWriteLine($file, $F2Skill1Delay&","&GUICtrlRead($F2Skill1Delay)&","&GUICtrlGetState($F2Skill1Delay)&",")
  5082. FileWriteLine($file, $F2Skill2&","&GUICtrlRead($F2Skill2)&","&GUICtrlGetState($F2Skill2)&",checkbox")
  5083. FileWriteLine($file, $F2Skill2Delay&","&GUICtrlRead($F2Skill2Delay)&","&GUICtrlGetState($F2Skill2Delay)&",")
  5084. FileWriteLine($file, $F2Skill3&","&GUICtrlRead($F2Skill3)&","&GUICtrlGetState($F2Skill3)&",checkbox")
  5085. FileWriteLine($file, $F2Skill3Delay&","&GUICtrlRead($F2Skill3Delay)&","&GUICtrlGetState($F2Skill3Delay)&",")
  5086. FileWriteLine($file, $F2Skill4&","&GUICtrlRead($F2Skill4)&","&GUICtrlGetState($F2Skill4)&",checkbox")
  5087. FileWriteLine($file, $F2Skill4Delay&","&GUICtrlRead($F2Skill4Delay)&","&GUICtrlGetState($F2Skill4Delay)&",")
  5088. FileWriteLine($file, $F2Skill6&","&GUICtrlRead($F2Skill6)&","&GUICtrlGetState($F2Skill6)&",checkbox")
  5089. FileWriteLine($file, $F2Skill6Delay&","&GUICtrlRead($F2Skill6Delay)&","&GUICtrlGetState($F2Skill6Delay)&",")
  5090. FileWriteLine($file, $F2Skill7&","&GUICtrlRead($F2Skill7)&","&GUICtrlGetState($F2Skill7)&",checkbox")
  5091. FileWriteLine($file, $F2Skill7Delay&","&GUICtrlRead($F2Skill7Delay)&","&GUICtrlGetState($F2Skill7Delay)&",")
  5092. FileWriteLine($file, $F2Skill9&","&GUICtrlRead($F2Skill9)&","&GUICtrlGetState($F2Skill9)&",checkbox")
  5093. FileWriteLine($file, $F2Skill9Delay&","&GUICtrlRead($F2Skill9Delay)&","&GUICtrlGetState($F2Skill9Delay)&",")
  5094. FileWriteLine($file, $characterselect&","&GUICtrlRead($characterselect)&","&GUICtrlGetState($characterselect)&",")
  5095. FileWriteLine($file, $serverselect&","&GUICtrlRead($serverselect)&","&GUICtrlGetState($serverselect)&",")
  5096. FileWriteLine($file, $delay1&","&GUICtrlRead($delay1)&","&GUICtrlGetState($delay1)&",")
  5097. FileWriteLine($file, $delay2&","&GUICtrlRead($delay2)&","&GUICtrlGetState($delay2)&",")
  5098. FileWriteLine($file, $delay3&","&GUICtrlRead($delay3)&","&GUICtrlGetState($delay3)&",")
  5099. FileWriteLine($file, $delay4&","&GUICtrlRead($delay4)&","&GUICtrlGetState($delay4)&",")
  5100. FileWriteLine($file, $delay5&","&GUICtrlRead($delay5)&","&GUICtrlGetState($delay5)&",")
  5101. FileWriteLine($file, $delay6&","&GUICtrlRead($delay6)&","&GUICtrlGetState($delay6)&",")
  5102. FileWriteLine($file, $upperleftX&","&GUICtrlRead($upperleftX)&","&GUICtrlGetState($upperleftX)&",")
  5103. FileWriteLine($file, $upperleftY&","&GUICtrlRead($upperleftY)&","&GUICtrlGetState($upperleftY)&",")
  5104. FileWriteLine($file, $upperrightX&","&GUICtrlRead($upperrightX)&","&GUICtrlGetState($upperrightX)&",")
  5105. FileWriteLine($file, $upperrightY&","&GUICtrlRead($upperrightY)&","&GUICtrlGetState($upperrightY)&",")
  5106. FileWriteLine($file, $lowerleftX&","&GUICtrlRead($lowerleftX)&","&GUICtrlGetState($lowerleftX)&",")
  5107. FileWriteLine($file, $lowerleftY&","&GUICtrlRead($lowerleftY)&","&GUICtrlGetState($lowerleftY)&",")
  5108. FileWriteLine($file, $lowerrightX&","&GUICtrlRead($lowerrightX)&","&GUICtrlGetState($lowerrightX)&",")
  5109. FileWriteLine($file, $lowerrightY&","&GUICtrlRead($lowerrightY)&","&GUICtrlGetState($lowerrightY)&",")
  5110. FileWriteLine($file, $tantradir&","&GUICtrlRead($tantradir)&","&GUICtrlGetState($tantradir)&",")
  5111.  
  5112. FileWriteLine($file, $bytes2read&","&GUICtrlRead($bytes2read)&","&GUICtrlGetState($bytes2read)&",")
  5113. FileWriteLine($file, $searchStart&","&GUICtrlRead($searchStart)&","&GUICtrlGetState($searchStart)&",")
  5114. FileWriteLine($file, $searchBytes&","&GUICtrlRead($searchBytes)&","&GUICtrlGetState($searchBytes)&",")
  5115. FileWriteLine($file, $currentaddress&","&GUICtrlRead($currentaddress)&","&GUICtrlGetState($currentaddress)&",")
  5116. FileWriteLine($file, $inputAddress&","&GUICtrlRead($inputAddress)&","&GUICtrlGetState($inputAddress)&",")
  5117. FileWriteLine($file, $APP1_ComboBOX&","&GUICtrlRead($APP1_ComboBOX)&","&GUICtrlGetState($APP1_ComboBOX)&",combobox")
  5118. FileWriteLine($file, $autologindelay&","&GUICtrlRead($autologindelay)&","&GUICtrlGetState($autologindelay)&",")
  5119.  
  5120.  
  5121.  
  5122. FileClose($file)
  5123.  
  5124.  
  5125. EndFunc
  5126.  
  5127.  
  5128. Func OpenConfig()
  5129.  
  5130. $configfile = FileOpenDialog( "Choose a name.", $currentdir, "booster101 (*.cfg)", 2)
  5131. ;If @error <> 1 Then GUICtrlCreateMenuitem ($configfile,$recentfilesmenu)
  5132.  
  5133. $file = FileOpen($configfile, 0)
  5134.  
  5135. If $file = -1 Then
  5136.   MsgBox(0, "Error", "Unable to open file.")
  5137.   Exit
  5138. EndIf
  5139.  
  5140. While 1
  5141.    $line = FileReadLine($file)
  5142.    If @error = -1 Then ExitLoop
  5143.    $linelen = StringLen($line)
  5144.    $linecomma = StringInStr($line,",")
  5145.    $linecomma2 = StringInStr($line,",", 0, 2)
  5146.    $linecomma3 = StringInStr($line,",", 0, 3)
  5147.    $attribute = StringLeft($line, $linecomma - 1)
  5148.  
  5149.    $mytmp = StringLeft($line, $linecomma2 - 1)
  5150.    $mytmplen = StringLen($mytmp)
  5151.    $mytmpcomma = StringInStr($mytmp,",")
  5152.    $attributevalue = StringRight($mytmp, $mytmplen - $mytmpcomma)
  5153.  
  5154.    $mytmp = StringLeft($line, $linecomma3 - 1)
  5155.    $mytmplen = StringLen($mytmp)
  5156.    $attributestate = StringRight($mytmp, $mytmplen - $linecomma2)
  5157.    ;MsgBox(0,"info","attrib = "&$attribute & @CRLF & "value = "&$attributevalue & @CRLF & "State = "&$attributestate)
  5158.  
  5159.    If StringInStr($line, "checkbox") then
  5160.      GUICtrlSetState($attribute, $attributevalue)
  5161.      GUICtrlSetState($attribute, $attributestate)
  5162.    ElseIf StringInStr($line, "combobox") then
  5163.  
  5164.     GUICtrlSetData($attribute,"Mandara Portal|Entrance to Mara Land|Way to Coliseum|Entrance to Shambala|Anu Village|Shambala Castle|Holy Army's Barracks|Town of Ruins|Town of Ruins Westside Forest(1000)|Horseman Town Well|Horseman Dungeon 1st(600)|Horseman Dungeon 1st end|Horseman Dungeon 2nd(800)|Shambala Dungeon|Shambala Dungeon 1st(600)|Shambala Dungeon 1st end|Shambala Dungeon 2st(1000)|Shambala Castle|Jina Village Portal|Rest Place(400)|Country Borderline(400)|Small Sea Port|Pamir Plains(400)|Mantra Temple|Village of the Outcast|Flower Field(400)|Temple of Fire(400)|Brahma Castle|Vishnu Castle|Shiva Castle|Brahman Front Line|Brahman Right Flank|Brahman Left Flank|Vishnite Front Line|Vishnite Right Flank|Vishnite Left Flank|Shivan Front Line|Shivan Right Flank|Shivan Left Flank|Brahman Chaturanga|SHivan Chaturanga|Vishnite Chaturanga|Emperor's Tomb Entrance|[Not Yet Implemented]|West Tomb(20000)|East Tomb(20000)|Mahi Durga|Ahb Durga|Danva Durga|Nar Durga|Mahi Durga Gate|Ahb Durga Gate|Danva Durga Gate|Nar Durga Gate|Mahi Durga Stronghold|Ahb Durga Stronghold|Danva Durga Stronghold|Nar Durga Stronghold|Mahi Conference Hall|Ahb Conference Hall|Danva Conference Hall|Nar Conference Hall|Mahi Kaustbam|Ahb Kaustbam|Danva Kaustbam|Nar Kaustbam|Town Biryu|Biryu Commercial Area|Biryu Downtown Area|[Not Yet Implemented]|Mudha Dungeon[x]",$attributevalue)
  5165.       GUICtrlSetState($attribute, $attributestate)
  5166.    ElseIf StringInStr($line, "edit") then
  5167.       $attributevalue = StringReplace($attributevalue, "-", @CRLF)
  5168.       GUICtrlSetData($attribute, $attributevalue)
  5169.       GUICtrlSetState($attribute, $attributestate)
  5170.    Else
  5171.       GUICtrlSetData($attribute, $attributevalue)
  5172.       GUICtrlSetState($attribute, $attributestate)
  5173.    EndIf
  5174. Wend
  5175.  
  5176. FileClose($file)
  5177.  
  5178. EndFunc
  5179.  
  5180. Func OpenReadMeFile()
  5181.  
  5182.  
  5183. If FileExists("readme.txt") Then
  5184.         $rdme = ""
  5185.         ;Msgbox(0,"Info", $currentdir)
  5186.  
  5187.     $file = FileOpen("readme.txt", 0)
  5188.     ; Check if file opened for reading OK
  5189.     If $file = -1 Then
  5190.        MsgBox(0, "Error", "Unable to open file.")
  5191.        Exit
  5192.     EndIf
  5193.  
  5194. While 1
  5195.     $chars = FileRead($file, 1)
  5196.     If @error = -1 Then ExitLoop
  5197.         $rdme = $rdme + $chars
  5198.  
  5199. Wend
  5200.  
  5201.     FileClose($file)
  5202.  
  5203.    MsgBox(0, "Char read:", $rdme)
  5204. EndIf
  5205.  
  5206. EndFunc
  5207.  
  5208. Func MyAbout()
  5209.  
  5210. MsgBox(0,"About","Tantra Bot System Version "&$versionnumber& @CRLF & @CRLF & "Visit http://www.luciotan.com/board/thread-9644-1-1.html for updates." & @CRLF & @CRLF & "For web hosting and domain registration needs, please visit http://www.bigbytes.net")
  5211.  
  5212.  
  5213. EndFunc
  5214.  
  5215.  
  5216. Func ClickInControl( $szLR, $szTitle, $szText, $szControl, $nX, $nY )
  5217.   If $szLR <> "left" And $szLR <> "right" Then Return 0
  5218.   $hWnd = ControlGetHandle( $szTitle, $szText, $szControl )
  5219.   If @error Then Return 0
  5220.   $hWndDad = WinGetHandle( $szTitle, $szText )
  5221.   If @error Then Return 0
  5222.   $me = DLLCall( "kernel32.dll", "long", "GetCurrentThreadId" )
  5223.   $you = DLLCall( "user32.dll", "long", "GetWindowThreadProcessId", "hwnd", $hWndDad, "long_ptr", 0)
  5224.   $coord = _MakeLong( $nX, $nY )
  5225.   If $szLR = "left" Then
  5226.      $msg1 = 0x0201;WM_LBUTTONDOWN
  5227.      $msg2 = 0x0202;WM_LBUTTONUP
  5228.      $i = 0x0001;MK_LBUTTON
  5229.   Else
  5230.      $msg1 = 0x0204;WM_RBUTTONDOWN
  5231.      $msg2 = 0x0205;WM_RBUTTONUP
  5232.      $i = 0x0002;MK_RBUTTON
  5233.   EndIf
  5234.   $ret = DLLCall("user32.dll","int","AttachThreadInput","long",$me[0],"long",$you[0],"int",1)
  5235.   If $ret[0] = 0 Then Return 0
  5236.   $ret = DLLCall("user32.dll","long","PostMessage","hwnd",$hWnd,"int",$msg1,"int",$i,"int",$coord)
  5237.   If $ret[0] = 0 Then Return 0
  5238.   Sleep(100)
  5239.   $ret = DLLCall("user32.dll","long","PostMessage","hwnd",$hWnd,"int",$msg2,"int",0,"int",$coord)
  5240.   If $ret[0] = 0 Then Return 0
  5241.   DLLCall("user32.dll","int","AttachThreadInput","long",$me[0],"long",$you[0],"int",0)
  5242.   If $ret[0] = 0 Then Return 0
  5243.   Return 1
  5244. EndFunc
  5245.  
  5246. Func _MakeLong($LoWord,$HiWord)
  5247.   Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
  5248. EndFunc
  5249.  
  5250.  
  5251. Func _ProcessGetFirstWinHandle($process)
  5252.   ; Check given process actually exists
  5253.    $pid = ProcessExists($process)
  5254.    If Not $pid Then
  5255.       MsgBox(0,"Info","Given process does not exist: " & $process)
  5256.       Return 1
  5257.    EndIf
  5258.  
  5259.   ; Get window list
  5260.    $winList = WinList()
  5261.   $text = ""
  5262.   ; Find which windows go with this process
  5263.    For $i = 0 To $winList[0][0] - 1
  5264.       $testPid = WinGetProcess($winList[$i][0])
  5265.       ;MsgBox(0, "Details", "Title=" & $winList[$i][0] & @CRLF & "Handle=" & $winList[$i][1] & @CRLF & "$pid = " & $pid & @CRLF & "$testPid = " & $testPid)
  5266.  
  5267.  
  5268.       If $testPid = $pid Then
  5269.      MsgBox(0, "Details", "Title=" & $winList[$i][0] & @CRLF & "Handle=" & $winList[$i][1] & @CRLF & "PID = " & $pid)
  5270.          ;$a = $winList[$i][1]
  5271.      Return $winList[$i][1]
  5272.       EndIf
  5273.       ;$text = $text & $winList[$i][0] & " -- " & $winList[$i][1] & " -- " & $testPid & @CRLF
  5274.    Next
  5275.    Return 0
  5276. EndFunc
  5277.  
  5278. Func GetCharacterStatus()
  5279.  
  5280. If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then
  5281.   GUICtrlSetData($statuslabel,GetCharacterStatusData())
  5282. EndIf
  5283.  
  5284. EndFunc
  5285.  
  5286. Func GetCharacterStatusData()
  5287.  
  5288. $handle = WinGetHandle(GUICtrlRead($wintitle))
  5289. $PID = WinGetProcess(GUICtrlRead($wintitle))
  5290.  
  5291. $charname = _readText2($charactername)
  5292. $curHP = _GetData($baseAddressCharacter,$myCurHPoffset)
  5293. $TPCur = _GetData($baseAddressTargetMonster,$TPCurAddrOffset)
  5294.  
  5295. $a = "HP: " & String($curHP) & "  TP: " & $TPCur & "  "& $charname
  5296.  
  5297. return $a
  5298.  
  5299. EndFunc
  5300.  
  5301.  
  5302. Func CheckIfPause()
  5303.     If GUICtrlRead($pausecheckbox) = 1 then
  5304.         MsgBox(0,"Info","Paused...")
  5305.         GUICtrlSetState($pausecheckbox, 4)
  5306.         Call ("MenuLaunch")
  5307.     EndIf
  5308. EndFunc
  5309.  
  5310. Func ReadAllPortals()
  5311.  
  5312. $portalcount = 1
  5313. $startaddress = Number(GUICtrlRead($inputAddress)) - 168
  5314. GUICtrlSetData ($MonsterCombo, "",1)
  5315.  
  5316. Do
  5317.  
  5318. $portal = _readText2($startaddress - 68)
  5319. $portalcode = _GetAscii($startaddress)
  5320. If $portalcode <> 0 then
  5321.     ;GUICtrlSetData ($MonsterCombo, @CRLF&String($portalcount)&","&String($portalcode)&","&Hex($portalcode,2)&","&$portal,1)
  5322.         _writeValue($startaddress, Number(GUICtrlRead($inputAddress)))
  5323. EndIf
  5324. $startaddress = $startaddress + 168
  5325.  
  5326. $portalcount = $portalcount + 1
  5327.  
  5328. Until $portalcount = 96
  5329.  
  5330. MsgBox(0,"Info","Click Mandara portal now.")
  5331.  
  5332. EndFunc
  5333.  
  5334. Func RunDcx()
  5335.  
  5336. FileChangeDir ($currentdir)
  5337.  
  5338. RunWait("dcxBotv02.exe")
  5339.  
  5340.  
  5341. EndFunc
  5342.  
  5343.  
  5344. Func CheckInternetConnection()
  5345.  
  5346. FileChangeDir ($currentdir)
  5347. RunWait(@ComSpec & " /c " & "ping.exe yahoo.com > ip.txt","",@SW_HIDE)
  5348. sleep(1000)
  5349.  
  5350. If FileExists("tantraip.txt") Then
  5351.         ;Msgbox(0,"Info", $currentdir)
  5352.  
  5353.     $file = FileOpen("ip.txt", 0)
  5354.     ; Check if file opened for reading OK
  5355.     If $file = -1 Then
  5356.        MsgBox(0, "Error", "Unable to open file.")
  5357.        Exit
  5358.     EndIf
  5359.  
  5360.     While 1
  5361.        $line = FileReadLine($file)
  5362.        If @error = -1 Then ExitLoop
  5363.        If StringInStr($line,"bytes=") > 1 then
  5364.           FileClose($file)
  5365.           Return 1
  5366.        EndIf
  5367.     Wend
  5368.     FileClose($file)
  5369.  
  5370. Else
  5371.     MsgBox(4096,"Warning", "dialog.txt file does not exist. Unable to continue")
  5372. EndIf
  5373.  
  5374. Return 0
  5375.  
  5376.  
  5377. EndFunc
  5378.  
  5379. ; ----------------------------------------------------------------------------
  5380. ; <AUT2EXE INCLUDE-END: C:\Documents and Settings\All Users\Documents\Tantra\agit.au3>
  5381. ; ----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement