Advertisement
Guest User

Untitled

a guest
May 20th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.58 KB | None | 0 0
  1. ///Windows
  2. if keyboard_check(ord("P")) && global.typing = 0
  3. {
  4. isrecruit=1;
  5. }
  6.  
  7. if keyboard_check(ord("O")) && global.typing = 0
  8. {
  9. global.randactinit = 2;
  10. global.pauser = "on";
  11. }
  12.  
  13. if keyboard_check_pressed(ord("I")) && global.typing = 0
  14. {
  15. global.randactinit = 1;
  16. global.pauser = "on";
  17. }
  18. ////// Open Windows
  19. //Travel Window
  20. if mouse_check_button_pressed(mb_left) && global.randactstore = 0 && global.incity = 0
  21. {
  22. if (mouse_x>7 && mouse_x<118) && (mouse_y>136 && mouse_y<179)
  23. {
  24. if global.windowtype = "travelset"
  25. {
  26. win = 0;
  27. }
  28. if global.windowtype = ""
  29. {
  30. win = 1;
  31. }
  32. if win = 0
  33. {
  34. global.windowtype = "";
  35. global.pauser = "off";
  36. with (but_progress){
  37. instance_destroy()}
  38. with (but_autosort){
  39. instance_destroy()}
  40. }
  41. if win = 1
  42. {
  43. global.windowtype = "travelset";
  44. global.pauser = "off";
  45. }
  46. }
  47. }
  48. //Position Window
  49. if mouse_check_button_pressed(mb_left) && global.randactstore = 0
  50. {
  51. if (mouse_x>7 && mouse_x<118) && (mouse_y>44 && mouse_y<87)
  52. {
  53. if global.windowtype = "positionset"
  54. {
  55. win = 0;
  56. }
  57. if global.windowtype = ""
  58. {
  59. win = 1;
  60. }
  61. if win = 0
  62. {
  63. global.windowtype = "";
  64. global.pauser = "off";
  65. with (but_progress){
  66. instance_destroy()}
  67. with (but_autosort){
  68. instance_destroy()}
  69. }
  70. if win = 1
  71. {
  72. global.windowtype = "positionsetinit";
  73. global.pauser = "on";
  74. }
  75. }
  76. }
  77.  
  78. //City Wander Window
  79. if mouse_check_button_pressed(mb_left) && global.randactstore = 0 && global.incity = 1
  80. {
  81. if (mouse_x>7 && mouse_x<118) && (mouse_y>228 && mouse_y<271)
  82. {
  83. if global.windowtype = ""
  84. {
  85. win = 1;
  86. }
  87. if win = 1
  88. {
  89. global.windowtype = "randcity";
  90. global.randcityinit = 1;
  91. global.daystogame -= 1;
  92. global.logpass="You spend (1) Day wandering town.";
  93. win = 0;
  94. }
  95. }
  96. }
  97.  
  98. //City General Store
  99. if mouse_check_button_pressed(mb_left) && global.incity = 1
  100. {
  101. if (mouse_x>7 && mouse_x<118) && (mouse_y>136 && mouse_y<180)
  102. {
  103. if global.windowtype = ""
  104. {
  105. win = 1;
  106. }
  107. if win = 1
  108. {
  109. global.citystoreinit = 1;
  110. global.windowtype = "citystore";
  111. win = 0;
  112. }
  113. }
  114. }
  115.  
  116. ////// Yes No Window
  117. //Return to normal delay
  118.  
  119. if mouse_check_button_released(mb_left) && drawYN = 1
  120. {
  121. if (mouse_x>401 && mouse_x<451) && (mouse_y>160 && mouse_y<185)
  122. {
  123. global.qpass=global.qpassy;
  124. global.question = "";
  125. }
  126. if (mouse_x>471 && mouse_x<511) && (mouse_y>160 && mouse_y<185)
  127. {
  128. global.qpass=global.qpassn;
  129. global.question = "";
  130. }
  131. }
  132. if drawYN = 1
  133. {
  134. if keyboard_check(ord("Y"))
  135. {
  136. global.qpass = "true";
  137. global.question = "";
  138. }
  139. if keyboard_check(ord("N"))
  140. {
  141. global.qpass = "false";
  142. global.question = "";
  143. }
  144. }
  145. /////Check Window
  146. if mouse_check_button_pressed(mb_left) && drawCheck = 1
  147. {
  148. if (mouse_x>436 && mouse_x<486) && (mouse_y>160 && mouse_y<185)
  149. {
  150. global.qpass="ok";
  151. drawCheck = 0;
  152. global.question = "";
  153. show_debug_message("OK clicked");
  154. }
  155. }
  156.  
  157. //City Time Elapse Y/N
  158. if mouse_check_button_released(mb_left) && drawYN = 1 && global.qpass !=""
  159. {
  160. if global.qpass="lapseday"
  161. {
  162. global.logpass="You spend (1) Day doing nothing.";
  163. global.daystogame -= 1;
  164. global.qpass="";
  165. }
  166. if global.qpass="nolapse"
  167. {
  168. global.qpass="";
  169. }
  170. drawYN = 0;
  171. }
  172.  
  173. if mouse_check_button_released(mb_left) && global.incity = 1 && global.windowtype = "" && drawYN = 0
  174. {
  175. if (mouse_x>657 && mouse_x<793) && (mouse_y>7 && mouse_y<33)
  176. {
  177. global.question = "You have "+string(global.daystogame)+"days left.#Do you wish to wait (1) Day?";
  178. global.qpassy="lapseday";
  179. global.qpassn="nolapse";
  180. drawYN = 1;
  181. }
  182. }
  183.  
  184. ////// Choice Window
  185. //Indent Selected Button
  186. //if mouse_check_button_pressed(mb_left) && global.windowtype = "choice"
  187. if mouse_check_button_pressed(mb_left) && global.windowtype = "randact" || global.windowtype = "recruit"
  188. {
  189. if (mouse_x>global.choicebutton1x && mouse_x<global.choicebutton1x+24) && (mouse_y>global.choicebutton1y && mouse_y<global.choicebutton1y+28)
  190. {
  191. global.pressbutttemp = 1;
  192. global.choicebutton1x += indentamount;
  193. global.choicebutton1y += indentamount;
  194. }
  195. if (mouse_x>global.choicebutton2x && mouse_x<global.choicebutton2x+24) && (mouse_y>global.choicebutton2y && mouse_y<global.choicebutton2y+28)
  196. {
  197. global.pressbutttemp = 2
  198. global.choicebutton2x += indentamount;
  199. global.choicebutton2y += indentamount;
  200. }
  201. if (mouse_x>global.choicebutton3x && mouse_x<global.choicebutton3x+24) && (mouse_y>global.choicebutton3y && mouse_y<global.choicebutton3y+28)
  202. {
  203. global.pressbutttemp = 3
  204. global.choicebutton3x += indentamount;
  205. global.choicebutton3y += indentamount;
  206. }
  207. }
  208.  
  209. //Unindent Button if not selected
  210. //if mouse_check_button_released(mb_left) && global.windowtype = "choice"
  211. if mouse_check_button_released(mb_left) && global.windowtype = "randact" || global.windowtype = "recruit"
  212. {
  213. if global.pressbutttemp = 1
  214. {
  215. if (mouse_x>global.choicebutton1x && mouse_x<global.choicebutton1x+24) && (mouse_y>global.choicebutton1y && mouse_y<global.choicebutton1y+28)
  216. {
  217. global.pressbutt=1;
  218. global.pressbutttemp = 0;
  219. global.choicebutton1x -= indentamount;
  220. global.choicebutton1y -= indentamount;
  221. }
  222. else
  223. {
  224. global.pressbutttemp = 0;
  225. global.choicebutton1x -= indentamount;
  226. global.choicebutton1y -= indentamount;
  227. }
  228. }
  229. if global.pressbutttemp = 2
  230. {
  231. if (mouse_x>global.choicebutton2x && mouse_x<global.choicebutton2x+24) && (mouse_y>global.choicebutton2y && mouse_y<global.choicebutton2y+28)
  232. {
  233. global.pressbutt = 2;
  234. global.pressbutttemp = 0;
  235. global.choicebutton2x -= indentamount;
  236. global.choicebutton2y -= indentamount;
  237. }
  238. else
  239. {
  240. global.pressbutttemp = 0;
  241. global.choicebutton2x -= indentamount;
  242. global.choicebutton2y -= indentamount;
  243. }
  244. }
  245. if global.pressbutttemp = 3
  246. {
  247. if (mouse_x>global.choicebutton3x && mouse_x<global.choicebutton3x+24) && (mouse_y>global.choicebutton3y && mouse_y<global.choicebutton3y+28)
  248. {
  249. global.pressbutt = 3;
  250. global.pressbutttemp = 0;
  251. global.choicebutton3x -= indentamount;
  252. global.choicebutton3y -= indentamount;
  253. }
  254. else
  255. {
  256. global.pressbutttemp = 0;
  257. global.choicebutton3x -= indentamount;
  258. global.choicebutton3y -= indentamount;
  259. }
  260. }
  261. }
  262. ////End Choice Window
  263.  
  264. //////Travel Window
  265. //Indent Selected Button
  266. if mouse_check_button_pressed(mb_left) && global.windowtype = "travelset"
  267. {
  268. if (mouse_x>speedbutt1x && mouse_x<speedbutt1x+24) && (mouse_y>speedbutt1y && mouse_y<speedbutt1y+28)
  269. {
  270. global.pressbutt = 1;
  271. speedbutt1x += indentamount;
  272. speedbutt1y += indentamount;
  273. }
  274. if (mouse_x>speedbutt2x && mouse_x<speedbutt2x+24) && (mouse_y>speedbutt2y && mouse_y<speedbutt2y+28)
  275. {
  276. global.pressbutt = 2
  277. speedbutt2x += indentamount;
  278. speedbutt2y += indentamount;
  279. }
  280. if (mouse_x>speedbutt3x && mouse_x<speedbutt3x+24) && (mouse_y>speedbutt3y && mouse_y<speedbutt3y+28)
  281. {
  282. global.pressbutt = 3
  283. speedbutt3x += indentamount;
  284. speedbutt3y += indentamount;
  285. }
  286. if (mouse_x>speedbutt4x && mouse_x<speedbutt4x+24) && (mouse_y>speedbutt4y && mouse_y<speedbutt4y+28)
  287. {
  288. global.pressbutt = 4
  289. speedbutt4x += indentamount;
  290. speedbutt4y += indentamount;
  291. }
  292. }
  293.  
  294. //Button Work
  295. if mouse_check_button_released(mb_left) && global.windowtype = "travelset"
  296. {
  297. if (mouse_x>speedbutt1x && mouse_x<speedbutt1x+24) && (mouse_y>speedbutt1y && mouse_y<speedbutt1y+28) && global.pressbutt = 1
  298. {
  299. global.speed = 125;
  300. global.logpass="Speed set to Overly Cautious.";
  301. }
  302. if (mouse_x>speedbutt2x && mouse_x<speedbutt2x+24) && (mouse_y>speedbutt2y && mouse_y<speedbutt2y+28) && global.pressbutt = 2
  303. {
  304. global.speed = 200;
  305. global.logpass="Speed set to Normal";
  306. }
  307. if (mouse_x>speedbutt3x && mouse_x<speedbutt3x+24) && (mouse_y>speedbutt3y && mouse_y<speedbutt3y+28) && global.pressbutt = 3
  308. {
  309. global.speed = 275;
  310. global.logpass="Speed set to Reckless";
  311. }
  312. if (mouse_x>speedbutt4x && mouse_x<speedbutt4x+24) && (mouse_y>speedbutt4y && mouse_y<speedbutt4y+28) && global.pressbutt = 4
  313. {
  314. global.speed = 0;
  315. obj_startup.timerstore=0;
  316. global.logpass="The bus takes a pitstop.";
  317. }
  318. }
  319.  
  320. //Unindent Button if not selected
  321. if mouse_check_button_released(mb_left) && global.windowtype = "travelset"
  322. {
  323. if global.pressbutt = 1
  324. {
  325. global.pressbutt = 0
  326. speedbutt1x -= indentamount;
  327. speedbutt1y -= indentamount;
  328. }
  329. if global.pressbutt = 2
  330. {
  331. global.pressbutt = 0
  332. speedbutt2x -= indentamount;
  333. speedbutt2y -= indentamount;
  334. }
  335. if global.pressbutt = 3
  336. {
  337. global.pressbutt = 0
  338. speedbutt3x -= indentamount;
  339. speedbutt3y -= indentamount;
  340. }
  341. if global.pressbutt = 4
  342. {
  343. global.pressbutt = 0
  344. speedbutt4x -= indentamount;
  345. speedbutt4y -= indentamount;
  346. }
  347. }
  348. ////End Travel
  349.  
  350. ////Position Settings
  351. if global.windowtype = "positionsetinit"
  352. {
  353. global.windowtype = "positionset";
  354. global.butt_text="Autosort";
  355. global.butt_spr=9;
  356. global.butt_return=2;
  357. instance_create(300,20,but_autosort);
  358. }
  359.  
  360. if mouse_check_button_released(mb_left) && global.pressbutt = 2 && global.windowtype = "positionset"
  361. {
  362. show_debug_message("AUTO PLACING PLAYERS");
  363. global.pressbutt = -1;
  364. for (var i = 14; i > -1; i--;)
  365. {
  366. rosterset=asset_get_index("player"+string(i));
  367. rosterset.pos="";
  368. }
  369. //place Pitcher
  370. topstat=-1;
  371. topplayer=-1;
  372. for (var i = 14; i > -1; i--;)
  373. {
  374. rosterset=asset_get_index("player"+string(i));
  375. if rosterset.fullname != "" && rosterset.pos = ""
  376. {
  377. if rosterset.thr > topstat
  378. {
  379. topplayer=i;
  380. topstat=rosterset.thr;
  381. }
  382. }
  383. }
  384. rosterset=asset_get_index("player"+string(topplayer));
  385. rosterset.pos = "P";
  386. rosterset.boxcolor=global.posbox[0,3];
  387.  
  388. //place Catcher
  389. topstat=-1;
  390. topplayer=-1;
  391. for (var i = 14; i > -1; i--;)
  392. {
  393. rosterset=asset_get_index("player"+string(i));
  394. if rosterset.fullname != "" && rosterset.pos = ""
  395. {
  396. if rosterset.ref > topstat
  397. {
  398. topplayer=i;
  399. topstat=rosterset.ref;
  400. }
  401. }
  402. }
  403. rosterset=asset_get_index("player"+string(topplayer));
  404. rosterset.pos = "C";
  405. rosterset.boxcolor=global.posbox[1,3];
  406.  
  407. //place DesiHit
  408. topstat=-1;
  409. topplayer=-1;
  410. for (var i = 14; i > -1; i--;)
  411. {
  412. rosterset=asset_get_index("player"+string(i));
  413. if rosterset.fullname != "" && rosterset.pos = ""
  414. {
  415. if rosterset.pow > topstat
  416. {
  417. topplayer=i;
  418. topstat=rosterset.pow;
  419. }
  420. }
  421. }
  422. rosterset=asset_get_index("player"+string(topplayer));
  423. rosterset.pos = "DH";
  424. rosterset.boxcolor=global.posbox[9,3];
  425.  
  426. //place First Base
  427. topstat=-1;
  428. topplayer=-1;
  429. for (var i = 14; i > -1; i--;)
  430. {
  431. rosterset=asset_get_index("player"+string(i));
  432. if rosterset.fullname != "" && rosterset.pos = ""
  433. {
  434. if rosterset.ref > topstat
  435. {
  436. topplayer=i;
  437. topstat=rosterset.ref;
  438. }
  439. }
  440. }
  441. rosterset=asset_get_index("player"+string(topplayer));
  442. rosterset.pos = "1B";
  443. rosterset.boxcolor=global.posbox[2,3];
  444.  
  445. //place Short Stop
  446. topstat=-1;
  447. topplayer=-1;
  448. for (var i = 14; i > -1; i--;)
  449. {
  450. rosterset=asset_get_index("player"+string(i));
  451. if rosterset.fullname != "" && rosterset.pos = ""
  452. {
  453. if rosterset.ref > topstat
  454. {
  455. topplayer=i;
  456. topstat=rosterset.ref;
  457. }
  458. }
  459. }
  460. rosterset=asset_get_index("player"+string(topplayer));
  461. rosterset.pos = "SS";
  462. rosterset.boxcolor=global.posbox[5,3];
  463.  
  464. //place Second Base
  465. topstat=-1;
  466. topplayer=-1;
  467. for (var i = 14; i > -1; i--;)
  468. {
  469. rosterset=asset_get_index("player"+string(i));
  470. if rosterset.fullname != "" && rosterset.pos = ""
  471. {
  472. if rosterset.ref > topstat
  473. {
  474. topplayer=i;
  475. topstat=rosterset.ref;
  476. }
  477. }
  478. }
  479. rosterset=asset_get_index("player"+string(topplayer));
  480. rosterset.pos = "2B";
  481. rosterset.boxcolor=global.posbox[3,3];
  482.  
  483. //place Center Field
  484. topstat=-1;
  485. topplayer=-1;
  486. for (var i = 14; i > -1; i--;)
  487. {
  488. rosterset=asset_get_index("player"+string(i));
  489. if rosterset.fullname != "" && rosterset.pos = ""
  490. {
  491. if rosterset.thr > topstat
  492. {
  493. topplayer=i;
  494. topstat=rosterset.thr;
  495. }
  496. }
  497. }
  498. rosterset=asset_get_index("player"+string(topplayer));
  499. rosterset.pos = "CF";
  500. rosterset.boxcolor=global.posbox[7,3];
  501.  
  502. //place Left Field
  503. topstat=-1;
  504. topplayer=-1;
  505. for (var i = 14; i > -1; i--;)
  506. {
  507. rosterset=asset_get_index("player"+string(i));
  508. if rosterset.fullname != "" && rosterset.pos = ""
  509. {
  510. if rosterset.thr > topstat
  511. {
  512. topplayer=i;
  513. topstat=rosterset.thr;
  514. }
  515. }
  516. }
  517. rosterset=asset_get_index("player"+string(topplayer));
  518. rosterset.pos = "LF";
  519. rosterset.boxcolor=global.posbox[6,3];
  520.  
  521. //place Third Base
  522. topstat=-1;
  523. topplayer=-1;
  524. for (var i = 14; i > -1; i--;)
  525. {
  526. rosterset=asset_get_index("player"+string(i));
  527. if rosterset.fullname != "" && rosterset.pos = ""
  528. {
  529. if rosterset.ref > topstat
  530. {
  531. topplayer=i;
  532. topstat=rosterset.ref;
  533. }
  534. }
  535. }
  536. rosterset=asset_get_index("player"+string(topplayer));
  537. rosterset.pos = "3B";
  538. rosterset.boxcolor=global.posbox[4,3];
  539.  
  540. //place Right Field
  541. topstat=-1;
  542. topplayer=-1;
  543. for (var i = 14; i > -1; i--;)
  544. {
  545. rosterset=asset_get_index("player"+string(i));
  546. if rosterset.fullname != "" && rosterset.pos = ""
  547. {
  548. if rosterset.thr > topstat
  549. {
  550. topplayer=i;
  551. topstat=rosterset.thr;
  552. }
  553. }
  554. }
  555. rosterset=asset_get_index("player"+string(topplayer));
  556. rosterset.pos = "RF";
  557. rosterset.boxcolor=global.posbox[8,3];
  558. }
  559.  
  560.  
  561. //Pick up
  562. if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer = -1
  563. {
  564. for (var i = 9; i > -1; i--;)
  565. {
  566. if (mouse_x>global.posbox[i,0]-10 && mouse_x<global.posbox[i,0]+22) && (mouse_y>global.posbox[i,1]-10 && mouse_y<global.posbox[i,1]+22)
  567. {
  568. show_debug_message("Picking Up Position");
  569. pospick = global.posbox[i,2];
  570. for (var v = 14; v > -1; v--;)
  571. {
  572. rosterset=asset_get_index("player"+string(v));
  573. if rosterset.pos=pospick
  574. {
  575. show_debug_message("Pickup Pos Player Found");
  576. playpick = v;
  577. cursorpickup=1;
  578. rosterset.pos="";
  579. rosterset.boxcolor=c_gray;
  580. }
  581. }
  582. }
  583. }
  584. }
  585. //pickup list
  586. if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer = -1
  587. {
  588. for (var i = 14; i > -1; i--;)
  589. {
  590. if (mouse_x>134 && mouse_x<247) && (mouse_y>20+(16*i) && mouse_y<39+(16*i))
  591. {
  592. show_debug_message("Pick Up List");
  593. playpick = global.playerlist[i];
  594. rosterset=asset_get_index("player"+string(global.playerlist[i]));
  595. rosterset.boxcolor=c_gray;
  596. if playpick = 15
  597. {
  598. cursorpickup=0;
  599. }
  600. else
  601. {
  602. cursorpickup=1;
  603. }
  604. rosterset.pos="";
  605. }
  606. }
  607. }
  608.  
  609. //Put Down
  610. if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer != -1
  611. {
  612. for (var i = 9; i > -1; i--;)
  613. {
  614. if (mouse_x>global.posbox[i,0]-10 && mouse_x<global.posbox[i,0]+22) && (mouse_y>global.posbox[i,1]-10 && mouse_y<global.posbox[i,1]+22)
  615. {
  616. show_debug_message("Detecting Position of Placement");
  617. posdetect=global.posbox[i,2];
  618. rosterset=asset_get_index("player"+string(cursorplayer));
  619. show_debug_message("player "+rosterset.fullname+" changed color from "+string(rosterset.boxcolor)+" to "+string(global.posbox[i,3]));
  620. rosterset.pos=global.posbox[i,2];
  621. rosterset.boxcolor=global.posbox[i,3];
  622. posboxstore=i;
  623. }
  624. }
  625. if posdetect != ""
  626. {
  627. rosterset=asset_get_index("player"+string(cursorplayer));
  628. global.logpass=rosterset.fullname +" is now " + posdetect;
  629. posdetect="";
  630. playerdetect = -1;
  631. cursorplayer = -1;
  632. playpick=1;
  633. pospick="";
  634. }
  635. else
  636. {
  637. show_debug_message("Spot Not Detected");
  638. rosterset.pos = "";
  639. posdetect="";
  640. playerdetect = -1;
  641. cursorplayer = -1;
  642. playpick=1;
  643. pospick="";
  644. }
  645. }
  646.  
  647. if cursorpickup = 1
  648. {
  649. cursorplayer = playpick;
  650. cursorpickup = 0;
  651. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement