Advertisement
Doug4347

AHK CabTimer 3.1

Mar 7th, 2015
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Menu, Tray, Add
  2. Menu, Tray, Add, Settings, Settings
  3. Menu, Tray, Add, Info, Info
  4. Menu, Tray, Add, Create Recipt, CabRecipt
  5. TrayTip, Cab Timer, Cab Timer Script running`, click the 'Info' button in the tray menu for more information.
  6. IfNotExist, CabTimer.ini
  7. {
  8. Goto, Settings
  9. }
  10. Return
  11.  
  12. Settings:
  13. IniRead, BasePrice, CabTimer.ini, General, BasePrice, 0
  14. IniRead, PricePerSecond, CabTimer.ini, General, PricePerSecond, 0
  15. IniRead, Saying, CabTimer.ini, General, Saying, Thank you for using our cab company, your price comes to $%TotalCash%.
  16. IniRead, F1N, CabTimer.ini, Fines, F1N, Vomiting
  17. IniRead, F1A, CabTimer.ini, Fines, F1A, 0
  18. IniRead, F2N, CabTimer.ini, Fines, F2N, Bad Language
  19. IniRead, F2A, CabTimer.ini, Fines, F2A, 0
  20. IniRead, F3N, CabTimer.ini, Fines, F3N, Rudeness
  21. IniRead, F3A, CabTimer.ini, Fines, F3A, 0
  22. IniRead, F4N, CabTimer.ini, Fines, F4N, Being drunk
  23. IniRead, F4A, CabTimer.ini, Fines, F4A, 0
  24. IniRead, F5N, CabTimer.ini, Fines, F5N, Urinating in the car
  25. IniRead, F5A, CabTimer.ini, Fines, F5A, 0
  26. IniRead, D1N, CabTimer.ini, Discounts, D1N, VIP
  27. IniRead, D1A, CabTimer.ini, Discounts, D1A, 0
  28. IniRead, D2N, CabTimer.ini, Discounts, D2N, Second time using the service
  29. IniRead, D2A, CabTimer.ini, Discounts, D2A, 0
  30. IniRead, D3N, CabTimer.ini, Discounts, D3N, First customer of the day
  31. IniRead, D3A, CabTimer.ini, Discounts, D3A, 0
  32. IniRead, D4N, CabTimer.ini, Discounts, D4N, Special Price of the Day
  33. IniRead, D4A, CabTimer.ini, Discounts, D4A, 0
  34. IniRead, D5N, CabTimer.ini, Discounts, D5N, Family & Friends discount
  35. IniRead, D5A, CabTimer.ini, Discounts, D5A, 0
  36.  
  37. Gui, Destroy
  38. Gui, Font, s10, Verdana  
  39. Gui, Add, Text, w250, Welcome to the Cab Timer! Please insert your settings below!
  40. Gui, Add, Button, w250 gSubmitSettings, Submit
  41. Gui, Add, Tab2, w250 h600, General|Fines|Discounts
  42. Gui, Tab, General
  43. Gui, Add, Text, w200, Base Price:
  44. Gui, Add, Edit, w200 vBasePrice, %BasePrice%
  45. Gui, Add, Text, w200, Price Per Second:
  46. Gui, Add, Edit, w200 vPricePerSecond, %PricePerSecond%
  47. Gui, Add, Text, w200,
  48. Gui, Add, Text, w200, What to say when you tell the customer the price:
  49. Gui, Add, Edit, w200 vSaying, %Saying%
  50. Gui, Tab, Fines
  51. Gui, Add, Text, w200, Fine 1 Name:
  52. Gui, Add, Edit, w200 vF1N, %F1N%
  53. Gui, Add, Text, w200, Fine 1 Amount:
  54. Gui, Add, Edit, w200 vF1A, %F1A%
  55. Gui, Add, Text, w200, Fine 2 Name:
  56. Gui, Add, Edit, w200 vF2N, %F2N%
  57. Gui, Add, Text, w200, Fine 2 Amount:
  58. Gui, Add, Edit, w200 vF2A, %F2A%
  59. Gui, Add, Text, w200, Fine 3 Name:
  60. Gui, Add, Edit, w200 vF3N, %F3N%
  61. Gui, Add, Text, w200, Fine 3 Amount:
  62. Gui, Add, Edit, w200 vF3A, %F3A%
  63. Gui, Add, Text, w200, Fine 4 Name
  64. Gui, Add, Edit, w200 vF4N, %F4N%
  65. Gui, Add, Text, w200, Fine 4 Amount:
  66. Gui, Add, Edit, w200 vF4a, %F4A%
  67. Gui, Add, Text, w200, Fine 5 Name:
  68. Gui, Add, Edit, w200 vF5N, %F5N%
  69. Gui, Add, Text, w200, Fine 5 Amount:
  70. Gui, Add, Edit, w200 vF5A, %F5A%
  71. Gui, Tab, Discounts
  72. Gui, Add, Text, w200, Discount 1 Name:
  73. Gui, Add, Edit, w200 vD1N, %D1N%
  74. Gui, Add, Text, w200, Discount 1 Amount:
  75. Gui, Add, Edit, w200 vD1A, %D1A%
  76. Gui, Add, Text, w200, Discount 2 Name:
  77. Gui, Add, Edit, w200 vD2N, %D2N%
  78. Gui, Add, Text, w200, Discount 2 Amount:
  79. Gui, Add, Edit, w200 vD2A, %D2A%
  80. Gui, Add, Text, w200, Discount 3 Name:
  81. Gui, Add, Edit, w200 vD3N, %D3N%
  82. Gui, Add, Text, w200, Discount 3 Amount:
  83. Gui, Add, Edit, w200 vD3A, %D3A%
  84. Gui, Add, Text, w200, Discount 4 Name:
  85. Gui, Add, Edit, w200 vD4N, %D4N%
  86. Gui, Add, Text, w200, Discount 4 Amount:
  87. Gui, Add, Edit, w200 vD4a, %D4A%
  88. Gui, Add, Text, w200, Discount 5 Name:
  89. Gui, Add, Edit, w200 vD5N, %D5N%
  90. Gui, Add, Text, w200, Discount 5 Amount:
  91. Gui, Add, Edit, w200 vD5A, %D5A%
  92. Gui, Show
  93. Return
  94.  
  95. Info:
  96. Gui, Destroy
  97. Gui, Font, s10, Verdana  
  98. Gui, Add, Text, w600,
  99. (
  100. Welcome to CabTimer 3!
  101.  
  102. Here, you can find some info regarding the program. If I've missed anything, please feel free to email me at doug4347@gmail.com or PM me on the MTG forums (New Era)
  103. )
  104. Gui, Add, Tab2, w620 h500, General|Fines & Discounts|Hotkeys
  105. Gui, Tab, General
  106. Gui, Add, Text, w600,
  107. (
  108. When entering something into the 'What to say when you tell the customer the price' box, you can use any text you want. BUT, remember this:
  109. Any special characters such as !,@,#,$,`%,^,&,*, must be written as {!}, {@}, etc. or you can add '`' just before it. this doesn't apply for punctuation marks, just items such as !, ^, #, +, etc. This is to prevent the script from pressing {ALT} instead of {!}, etc.
  110.  
  111. You can also add any of the following (replace '#' with 1-5):
  112. Prices for Discounts: `%D#A`%
  113. Names of Discounts: `%D#N`%
  114. Prices of Fines: `%F#A`%
  115. Names of Fines: `%F#N`%
  116. Base Price: `%BasePrice`%
  117. Price Per Second: `%PricePerSecond`%
  118. )
  119.  
  120. Gui, Tab, Fines & Discounts
  121. Gui, Add, Text, w600,
  122. (
  123. When using the discounts, please remember that you are REMOVING the amount stated from the full price. i.e. If you have a $100 discount and the total should be $300, then the total price will be $200.
  124. When using the fines, please remember that you are ADDING the amount stated from the full price. i.e. If you have a $100 fine and the total should be $300, then the total price will be $400.
  125.  
  126. Use discounts for removing amounts from the total price and use fines to add amounts to the total price.
  127.  
  128. )
  129.  
  130. Gui, Tab, Fines & Discounts
  131. Gui, Add, Text, w600,
  132. (
  133. Hotkey list:
  134. [ALT] + ...
  135. [1] = Timer on
  136. [2] = Timer off
  137. [3] = Pause Script
  138. [4] = Type out your saying.
  139. [9] = Create a new AHK script with the latest fare's info in it. Can be found in the same folder as the script.
  140.  
  141. [ALT] + [NUMPAD...]
  142. [0] = Add Fine 1
  143. [1] = Add Fine 2
  144. [2] = Add Fine 3
  145. [3] = Add Fine 4
  146. [4] = Add Fine 5
  147. [5] = Add Discount 1
  148. [6] = Add Discount 2
  149. [7] = Add Discount 3
  150. [8] = Add Discount 4
  151. [9] = Add Discount 5
  152.  
  153. [CTRL] + [NUMPAD...]
  154. [0] = Remove Fine 1
  155. [1] = Remove Fine 2
  156. [2] = Remove Fine 3
  157. [3] = Remove Fine 4
  158. [4] = Remove Fine 5
  159. [5] = Remove Discount 1
  160. [6] = Remove Discount 2
  161. [7] = Remove Discount 3
  162. [8] = Remove Discount 4
  163. [9] = Remove Discount 5
  164.  
  165. Remember that a single beep means 'On' and a double beep means 'Off'.
  166. The Pause hotkey and the hotkey to type out your saying do not have any beeps.
  167. )
  168.  
  169.  
  170.  
  171. Gui, Show
  172. Return
  173.  
  174. SubmitSettings:
  175. Gui, Submit, NoHide
  176. IniWrite, %BasePrice%, CabTimer.ini, General, BasePrice
  177. IniWrite, %PricePerSecond%, CabTimer.ini, General, PricePerSecond
  178. IniWrite, %Saying%, CabTimer.ini, General, Saying
  179. IniWrite, %F1N%, CabTimer.ini, Fines, F1N
  180. IniWrite, %F1A%, CabTimer.ini, Fines, F1A
  181. IniWrite, %F2N%, CabTimer.ini, Fines, F2N
  182. IniWrite, %F2A%, CabTimer.ini, Fines, F2A
  183. IniWrite, %F3N%, CabTimer.ini, Fines, F3N
  184. IniWrite, %F3A%, CabTimer.ini, Fines, F3A
  185. IniWrite, %F4N%, CabTimer.ini, Fines, F4N
  186. IniWrite, %F4A%, CabTimer.ini, Fines, F4A
  187. IniWrite, %F5N%, CabTimer.ini, Fines, F5N
  188. IniWrite, %F5A%, CabTimer.ini, Fines, F5A
  189. IniWrite, %D1N%, CabTimer.ini, Discounts, D1N
  190. IniWrite, %D1A%, CabTimer.ini, Discounts, D1A
  191. IniWrite, %D2N%, CabTimer.ini, Discounts, D2N
  192. IniWrite, %D2A%, CabTimer.ini, Discounts, D2A
  193. IniWrite, %D3N%, CabTimer.ini, Discounts, D3N
  194. IniWrite, %D3A%, CabTimer.ini, Discounts, D3A
  195. IniWrite, %D4N%, CabTimer.ini, Discounts, D4N
  196. IniWrite, %D4A%, CabTimer.ini, Discounts, D4A
  197. IniWrite, %D5N%, CabTimer.ini, Discounts, D5N
  198. IniWrite, %D5A%, CabTimer.ini, Discounts, D5A
  199. MsgBox, 64, Cab Timer, Your settings have been saved!
  200. Return
  201.  
  202. GuiClose:
  203. Gui, Destroy
  204. Return
  205. !9:: Goto, CabRecipt
  206. !1::
  207. SoundBeep
  208. Seconds:=0
  209. F1Active:=0
  210. F2Active:=0
  211. F3Active:=0
  212. F4Active:=0
  213. F5Active:=0
  214. D1Active:=0
  215. D2Active:=0
  216. D3Active:=0
  217. D4Active:=0
  218. D5Active:=0
  219. SetTimer, CabTime, 0
  220. SetTimer, CabTime, On
  221. Return
  222. !2::
  223. SetTimer, CabTime, Off
  224. SoundBeep
  225. Sleep, 100
  226. SoundBeep
  227. Return
  228. !3:: Pause
  229. !4::
  230. IniRead, Saying, CabTimer.ini, General, Saying, Thank you for using our cab company, your price comes to $%TotalCash%.
  231. SendInput, t%Saying%
  232. Return
  233.  
  234. !Numpad0::
  235. F1Active:=1
  236. SoundBeep
  237. Return
  238. !Numpad1::
  239. F2Active:=1
  240. SoundBeep
  241. Return
  242. !Numpad2::
  243. F3Active:=1
  244. SoundBeep
  245. Return
  246. !Numpad3::
  247. F4Active:=1
  248. SoundBeep
  249. Return
  250. !Numpad4::
  251. F5Active:=1
  252. SoundBeep
  253. Return
  254. !Numpad5::
  255. D1Active:=1
  256. SoundBeep
  257. Return
  258. !Numpad6::
  259. D2Active:=1
  260. SoundBeep
  261. Return
  262. !Numpad7::
  263. D3Active:=1
  264. SoundBeep
  265. Return
  266. !Numpad8::
  267. D4Active:=1
  268. SoundBeep
  269. Return
  270. !Numpad9::
  271. D5Active:=1
  272. SoundBeep
  273. Return
  274.  
  275. ^Numpad0::
  276. F1Active:=0
  277. SoundBeep
  278. Sleep, 100
  279. SoundBeep
  280. Return
  281. ^Numpad1::
  282. F2Active:=0
  283. SoundBeep
  284. Sleep, 100
  285. SoundBeep
  286. Return
  287. ^Numpad2::
  288. F3Active:=0
  289. SoundBeep
  290. Sleep, 100
  291. SoundBeep
  292. Return
  293. ^Numpad3::
  294. F4Active:=0
  295. SoundBeep
  296. Sleep, 100
  297. SoundBeep
  298. Return
  299. ^Numpad4::
  300. F5Active:=0
  301. SoundBeep
  302. Sleep, 100
  303. SoundBeep
  304. Return
  305. ^Numpad5::
  306. D1Active:=0
  307. SoundBeep
  308. Sleep, 100
  309. SoundBeep
  310. Return
  311. ^Numpad6::
  312. D2Active:=0
  313. SoundBeep
  314. Sleep, 100
  315. SoundBeep
  316. Return
  317. ^Numpad7::
  318. D3Active:=0
  319. SoundBeep
  320. Sleep, 100
  321. SoundBeep
  322. Return
  323. ^Numpad8::
  324. D4Active:=0
  325. SoundBeep
  326. Sleep, 100
  327. SoundBeep
  328. Return
  329. ^Numpad9::
  330. D5Active:=0
  331. SoundBeep
  332. Sleep, 100
  333. SoundBeep
  334. Return
  335.  
  336. CabTime:
  337. IniRead, BasePrice, CabTimer.ini, General, BasePrice, 0
  338. IniRead, PricePerSecond, CabTimer.ini, General, PricePerSecond, 0
  339. IniRead, F1N, CabTimer.ini, Fines, F1N, Vomiting
  340. IniRead, F1A, CabTimer.ini, Fines, F1A, 0
  341. IniRead, F2N, CabTimer.ini, Fines, F2N, Bad Language
  342. IniRead, F2A, CabTimer.ini, Fines, F2A, 0
  343. IniRead, F3N, CabTimer.ini, Fines, F3N, Rudeness
  344. IniRead, F3A, CabTimer.ini, Fines, F3A, 0
  345. IniRead, F4N, CabTimer.ini, Fines, F4N, Being drunk
  346. IniRead, F4A, CabTimer.ini, Fines, F4A, 0
  347. IniRead, F5N, CabTimer.ini, Fines, F5N, Urinating in the car
  348. IniRead, F5A, CabTimer.ini, Fines, F5A, 0
  349. IniRead, D1N, CabTimer.ini, Discounts, D1N, VIP
  350. IniRead, D1A, CabTimer.ini, Discounts, D1A, 0
  351. IniRead, D2N, CabTimer.ini, Discounts, D2N, Second time using the service
  352. IniRead, D2A, CabTimer.ini, Discounts, D2A, 0
  353. IniRead, D3N, CabTimer.ini, Discounts, D3N, First customer of the day
  354. IniRead, D3A, CabTimer.ini, Discounts, D3A, 0
  355. IniRead, D4N, CabTimer.ini, Discounts, D4N, Special Price of the Day
  356. IniRead, D4A, CabTimer.ini, Discounts, D4A, 0
  357. IniRead, D5N, CabTimer.ini, Discounts, D5N, Family & Friends discount
  358. IniRead, D5A, CabTimer.ini, Discounts, D5A, 0
  359. Seconds+=1
  360. TotalCash:=(Seconds * PricePerSecond) + BasePrice
  361. If F1Active = 1
  362. {
  363. TotalCash+=F1A
  364. }
  365. If F2Active = 1
  366. {
  367. TotalCash+=F2A
  368. }
  369. If F3Active = 1
  370. {
  371. TotalCash+=F3A
  372. }
  373. If F4Active = 1
  374. {
  375. TotalCash+=F4A
  376. }
  377. If F5Active = 1
  378. {
  379. TotalCash+=F5A
  380. }
  381.  
  382. If D1Active = 1
  383. {
  384. TotalCash-=D1A
  385. }
  386. If D2Active = 1
  387. {
  388. TotalCash-=D2A
  389. }
  390. If D3Active = 1
  391. {
  392. TotalCash-=D3A
  393. }
  394. If D4Active = 1
  395. {
  396. TotalCash-=D4A
  397. }
  398. If D5Active = 1
  399. {
  400. TotalCash-=D5A
  401. }
  402. SplashImage,,,
  403. (
  404. Time: %Seconds% Seconds
  405. Price: $%TotalCash%
  406. Fines:
  407. %F1N%: %F1Active%
  408. %F2N%: %F2Active%
  409. %F3N%: %F3Active%
  410. %F4N%: %F4Active%
  411. %F5N%: %F5Active%
  412. Discounts:
  413. %D1N%: %D1Active%
  414. %D2N%: %D2Active%
  415. %D3N%: %D3Active%
  416. %D4N%: %D4Active%
  417. %D5N%: %D5Active%
  418. )
  419. Sleep, 1000
  420. Return
  421.  
  422. CabRecipt:
  423. If D1Active = 1
  424. {
  425. D1Act = %D1A%
  426. }
  427. If D2Active = 1
  428. {
  429. D2Act = %D2A%
  430. }
  431. If D3Active = 1
  432. {
  433. D3Act = %D3A%
  434. }
  435. If D4Active = 1
  436. {
  437. D4Act = %D4A%
  438. }
  439. If D5Active = 1
  440. {
  441. D5Act = %D5A%
  442. }
  443. If F1Active = 1
  444. {
  445. F1Act = %F1A%
  446. }
  447. If F2Active = 1
  448. {
  449. F2Act = %F2A%
  450. }
  451. If F3Active = 1
  452. {
  453. F3Act = %F3A%
  454. }
  455. If F4Active = 1
  456. {
  457. F4Act = %F4A%
  458. }
  459. If F5Active = 1
  460. {
  461. F5Act = %F5A%
  462. }
  463. If D1Active = 0
  464. {
  465. D1Act = 0
  466. }
  467. If D2Active = 0
  468. {
  469. D2Act = 0
  470. }
  471. If D3Active = 0
  472. {
  473. D3Act = 0
  474. }
  475. If D4Active = 0
  476. {
  477. D4Act = 0
  478. }
  479. If D5Active = 0
  480. {
  481. D5Act = 0
  482. }
  483. If F1Active = 0
  484. {
  485. F1Act = 0
  486. }
  487. If F2Active = 0
  488. {
  489. F2Act = 0
  490. }
  491. If F3Active = 0
  492. {
  493. F3Act = 0
  494. }
  495. If F4Active = 0
  496. {
  497. F4Act = 0
  498. }
  499. If F5Active = 0
  500. {
  501. F5Act = 0
  502. }
  503.  
  504. FileAppend, Gui`, Add`, Text`,`, This is the pricing for the latest fare:`nGui`, Add`, Tab2`, w500 h500`, Price|Fines|Discounts`nGui`, Tab`, Price`nGui`, Add`, Text`,`,`n(`nTime: %Seconds% Seconds`nPrice: $%TotalCash%`n)`nGui`, Tab`, Fines`nGui`, Add`, Text`,`,`n(`n%D1N%: $%D1Act%`n%D2N%: $%D2Act%`n%D3N%: $%D3Act%`n%D4N%: $%D4Act%`n%D5N%: $%D5Act%`n)`nGui`, Tab`, Discounts`nGui`, Add`, Text`,`,`n(`n%F1N%: $%F1Act%`n%F2N%: $%F2Act%`n%F3N%: $%F3Act%`n%F4N%: $%F4Act%`n%F5N%: $%F5Act%`n)`nGui`, Show`nReturn`n`nGuiClose:`nExitApp`n, Fare - %A_YYYY%-%A_MM%-%A_DD% on %A_Hour%-%A_Min%-%A_Sec%.ahk
  505. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement