Advertisement
Vamperica

DR Armor

Sep 3rd, 2017
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##If the armor has a full name like gleaming silver armor, but the full noun for it is different
  2. ##If the armor has a full name like gleaming silver armor, but the full noun for it is different
  3. ## like gleaming armor, then set the armor name as an array ie. armor1_torso gleaming silver armor|gleaming armor
  4. ## set armor1 - armor7 as the type of armor you're using.  Must be hp lp hc lc bone leather cloth nothing
  5. ## armor3 - armor7 must be nothing if you're not using those types
  6. ## set the check variable to the area of armor you want the script to check to see which setup you're using
  7. ## IE.  If your chest armor stays the same, but your leg armor changes, set the check to legs
  8. ## set the pieces in each set up.  Leave them as nothing if you're not changing that piece.
  9. ##      VARIABLES
  10. ##You need to create 2 global variables.
  11. ##swap.learningrate -   Number from 1 to 33  this is the learning rate at which the script will change armors.
  12. ##                      This variable is REQUIRED
  13. ##swap.increaserate -   Number from 1 - 333  This number is the amount the swap.learningrate
  14. ##                      variable increase each time the swap script goes throug a set.  IE.  You set
  15. ##                      swap.learningrate to 5, and swap.increaserate to 2.  Everytime the script changes from the
  16. ##                      last armor to the first armor in the script, it will add 2 to swap.learningrate, up to a
  17. ##                      maximum of 33.  Use this if you're training too small a number of armors for the
  18. ##                      learning rate to drain down to 0 before it gets back to that armor.  This variable is OPTIONAL
  19.  
  20. gh_armor.start:
  21. #put #var DA OFF
  22. put #var GH_ARMOR.INCLUDE 1
  23. var gh.counter %c
  24. var gh.save %s
  25. var armor.location spidersilk backpack
  26.  
  27. if "$charactername" = "Vamperica" then
  28. {
  29. var armor1 hc
  30. var armor2 leather
  31. var armor3 lp
  32. var armor4 hp
  33. var armor5 nothing
  34. var armor6 nothing
  35. var armor7 nothing
  36. var check hands
  37.  
  38. #armor 1 pieces
  39. var armor1_head nothing
  40. var armor1_eyes nothing
  41. var armor1_neck nothing
  42. var armor1_torso nothing
  43. var armor1_arms nothing
  44. var armor1_hands chain gloves
  45. var armor1_legs nothing
  46.  
  47. #armor 2 pieces
  48. var armor2_head nothing
  49. var armor2_eyes nothing
  50. var armor2_neck nothing
  51. var armor2_torso nothing
  52. var armor2_arms nothing
  53. var armor2_hands rugged gloves
  54. var armor2_legs nothing
  55.  
  56. #armor 3 pieces
  57. var armor3_head nothing
  58. var armor3_eyes nothing
  59. var armor3_neck nothing
  60. var armor3_torso nothing
  61. var armor3_arms nothing
  62. var armor3_hands scale gloves
  63. var armor3_legs nothing
  64.  
  65. #armor 4 pieces
  66. var armor4_head nothing
  67. var armor4_eyes nothing
  68. var armor4_neck nothing
  69. var armor4_torso nothing
  70. var armor4_arms nothing
  71. var armor4_hands plate gauntlets
  72. var armor4_legs nothing
  73.  
  74. #armor 5 pieces
  75. var armor5_head nothing
  76. var armor5_eyes nothing
  77. var armor5_neck nothing
  78. var armor5_torso nothing
  79. var armor5_arms nothing
  80. var armor5_hands nothing
  81. var armor5_legs nothing
  82.  
  83. #armor 6 pieces
  84. var armor6_head nothing
  85. var armor6_eyes nothing
  86. var armor6_neck nothing
  87. var armor6_torso nothing
  88. var armor6_arms nothing
  89. var armor6_hands nothing
  90. var armor6_legs nothing
  91.  
  92. #armor 7 pieces
  93. var armor7_head nothing
  94. var armor7_eyes nothing
  95. var armor7_neck nothing
  96. var armor7_torso nothing
  97. var armor7_arms nothing
  98. var armor7_hands nothing
  99. var armor7_legs nothing
  100. }
  101.  
  102. if %armor1 = nothing then goto gh_armor.error
  103. else
  104. {
  105. save 1
  106. gosub %armor1
  107. }
  108. if %armor2 = nothing then goto gh_armor.error
  109. else
  110. {
  111. save 2
  112. gosub %armor2
  113. put #var GH_ARMOR_TOTAL 2
  114. }
  115. if %armor3 = nothing then goto check
  116. else
  117. {
  118. save 3
  119. gosub %armor3
  120. put #var GH_ARMOR_TOTAL 3
  121. }
  122. if %armor4 = nothing then goto check
  123. else
  124. {
  125. save 4
  126. gosub %armor4
  127. put #var GH_ARMOR_TOTAL 4
  128. }
  129. if %armor5 = nothing then goto check
  130. else
  131. {
  132. save 5
  133. gosub %armor5
  134. put #var GH_ARMOR_TOTAL 5
  135. }
  136. if %armor6 = nothing then goto check
  137. else
  138. {
  139. save 6
  140. gosub %armor6
  141. put #var GH_ARMOR_TOTAL 6
  142. }
  143. if %armor7 = nothing then goto check
  144. else
  145. {
  146. save 7
  147. gosub %armor7
  148. put #var GH_ARMOR_TOTAL 7
  149. }
  150. goto check
  151.  
  152. gh_armor.error:
  153. put #echo gotta set at least 2 armor variables or else what's the point?
  154. return
  155.  
  156. heavyplate:
  157. heavy_plate:
  158. hp:
  159. var armor%s.skill Plate_Armor.LearningRate
  160. return
  161.  
  162. lightplate:
  163. light_plate:
  164. lp:
  165. var armor%s.skill Brigandine.LearningRate
  166. return
  167.  
  168. heavychain:
  169. heavy_chain:
  170. hc:
  171. var armor%s.skill Chain_Armor.LearningRate
  172. return
  173.  
  174. lightchain:
  175. light_chain:
  176. lc:
  177. var armor%s.skill Chain_Armor.LearningRate
  178. return
  179.  
  180. leatherarmor:
  181. leather_armor:
  182. leather:
  183. leat:
  184. leath:
  185. la:
  186. var armor%s.skill Light_Armor.LearningRate
  187. return
  188.  
  189. clotharmor:
  190. cloth_armor:
  191. cloth:
  192. ca:
  193. var armor%s.skill Light_Armor.LearningRate
  194. return
  195.  
  196. nothing:
  197. return
  198.  
  199. remove:
  200. var location $1
  201. var armor.temp %armor%s_%location
  202. eval armor_count count("%armor.temp", "|"))
  203. remove.remove:
  204. if %armor_count = 1 then put remove my %armor.temp(1)
  205. else
  206. put remove my %armor.temp
  207. waitforre (^You|^\.\.\.wait|^Sorry, you)
  208. if matchre("$1", "...wait|^Sorry, you") then goto remove.remove
  209. remove.stow:
  210. if %armor_count = 1 then put stow my %armor.temp(1) in my %armor.location
  211. else
  212. put stow my %armor.temp in my %armor.location
  213. waitforre (^You|^\.\.\.wait|^Sorry, you)
  214. if matchre("$1", "...wait|^Sorry, you") then goto remove.stow
  215. return
  216.  
  217. armor.wear:
  218. var location $1
  219. var armor.temp %armor%s_%location
  220. eval armor_count count("%armor.temp", "|"))
  221. wear.get:
  222. if %armor_count = 1 then put get my %armor.temp(1) in my %armor.location
  223. else
  224. put get my %armor.temp in my %armor.location
  225. waitforre (^You|^\.\.\.wait|^Sorry, you)
  226. if matchre("$1", "...wait|^Sorry, you") then goto wear.get
  227. wear.wear:
  228. if %armor_count = 1 then put wear my %armor.temp(1)
  229. else
  230. put wear my %armor.temp
  231. waitforre (^You|^The|^\.\.\.wait|^Sorry, you)
  232. if matchre("$1", "...wait|^Sorry, you") then goto wear.wear
  233. return
  234.  
  235.  
  236. swap.retreat:
  237. matchre swap.retreat ^\.\.\.wait|^Sorry
  238. matchre return You retreat|You are
  239. put retreat
  240. matchwait 1
  241. return
  242.  
  243. check:
  244. put #echo *** check ***
  245. put sort auto head
  246. waitforre ^Your inventory
  247. put inv
  248. waitforre ^You are wearing (.+)
  249. var wearing $1
  250. pause .1
  251. if matchre("%wearing", "%armor1_%check") then goto armor1
  252. if matchre("%wearing", "%armor2_%check") then goto armor2
  253. if matchre("%wearing", "%armor3_%check") then goto armor3
  254. if matchre("%wearing", "%armor4_%check") then goto armor4
  255. if matchre("%wearing", "%armor5_%check") then goto armor5
  256. if matchre("%wearing", "%armor6_%check") then goto armor6
  257. if matchre("%wearing", "%armor7_%check") then goto armor7
  258. echo gh_armor check: match error
  259. exit
  260.  
  261. gh_armor.start.2:
  262. goto %swap.armormindlock
  263.  
  264. armor1:
  265. save 1
  266. var swap.armor armor1
  267. put #statusbar 9 %armor1.skill
  268. if $%armor1.skill >= $swap.learningrate then goto armor1mindlock
  269. goto swap.done
  270.  
  271. armor1mindlock:
  272. put #math GH_ARMOR_COUNT add 1
  273. gosub swap.retreat
  274. gosub swap.retreat
  275. save 1
  276. if "%armor%s_head" != "nothing" then gosub remove head
  277. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  278. if "%armor%s_neck" != "nothing" then gosub remove neck
  279. if "%armor%s_torso" != "nothing" then gosub remove torso
  280. if "%armor%s_arms" != "nothing" then gosub remove arms
  281. if "%armor%s_hands" != "nothing" then gosub remove hands
  282. if "%armor%s_legs" != "nothing" then gosub remove legs
  283. pause .1
  284. save 2
  285. if "%armor%s_head" != "nothing" then gosub armor.wear head
  286. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  287. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  288. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  289. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  290. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  291. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  292. var swap.armor armor2.skill
  293. goto swap.done
  294.  
  295. armor2:
  296. save 2
  297. var swap.armor armor2.skill
  298. put #statusbar 9 %armor2.skill
  299. if $%armor2.skill >= $swap.learningrate then goto armor2mindlock
  300. goto swap.done
  301.  
  302. armor2mindlock:
  303. put #math GH_ARMOR_COUNT add 1
  304. gosub swap.retreat
  305. gosub swap.retreat
  306. save 2
  307. if "%armor%s_head" != "nothing" then gosub remove head
  308. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  309. if "%armor%s_neck" != "nothing" then gosub remove neck
  310. if "%armor%s_torso" != "nothing" then gosub remove torso
  311. if "%armor%s_arms" != "nothing" then gosub remove arms
  312. if "%armor%s_hands" != "nothing" then gosub remove hands
  313. if "%armor%s_legs" != "nothing" then gosub remove legs
  314. pause .1
  315. if %armor3 = nothing then save 1
  316. else
  317. {
  318. save 3
  319. }
  320. if "%armor%s_head" != "nothing" then gosub armor.wear head
  321. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  322. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  323. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  324. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  325. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  326. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  327. var swap.armor armor%s.skill
  328. goto swap.done
  329.  
  330. armor3:
  331. save 3
  332. var swap.armor armor3.skill
  333. put #statusbar 9 %armor3.skill
  334. if $%armor3.skill >= $swap.learningrate then goto armor3mindlock
  335. goto swap.done
  336.  
  337. armor3mindlock:
  338. put #math GH_ARMOR_COUNT add 1
  339. gosub swap.retreat
  340. gosub swap.retreat
  341. save 3
  342. if "%armor%s_head" != "nothing" then gosub remove head
  343. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  344. if "%armor%s_neck" != "nothing" then gosub remove neck
  345. if "%armor%s_torso" != "nothing" then gosub remove torso
  346. if "%armor%s_arms" != "nothing" then gosub remove arms
  347. if "%armor%s_hands" != "nothing" then gosub remove hands
  348. if "%armor%s_legs" != "nothing" then gosub remove legs
  349. pause .1
  350. if %armor4 = nothing then save 1
  351. else
  352. {
  353. save 4
  354. }
  355. if "%armor%s_head" != "nothing" then gosub armor.wear head
  356. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  357. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  358. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  359. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  360. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  361. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  362. var swap.armor armor%s.skill
  363. goto swap.done
  364.  
  365. armor4:
  366. save 4
  367. var swap.armor armor4.skill
  368. put #statusbar 9 %armor4.skill
  369. if $%armor4.skill >= $swap.learningrate then goto armor4mindlock
  370. goto swap.done
  371.  
  372. armor4mindlock:
  373. put #math GH_ARMOR_COUNT add 1
  374. gosub swap.retreat
  375. gosub swap.retreat
  376. save 4
  377. if "%armor%s_head" != "nothing" then gosub remove head
  378. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  379. if "%armor%s_neck" != "nothing" then gosub remove neck
  380. if "%armor%s_torso" != "nothing" then gosub remove torso
  381. if "%armor%s_arms" != "nothing" then gosub remove arms
  382. if "%armor%s_hands" != "nothing" then gosub remove hands
  383. if "%armor%s_legs" != "nothing" then gosub remove legs
  384. pause .1
  385. if %armor5 = nothing then save 1
  386. else
  387. {
  388. save 5
  389. }
  390. if "%armor%s_head" != "nothing" then gosub armor.wear head
  391. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  392. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  393. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  394. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  395. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  396. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  397. var swap.armor armor%s.skill
  398. goto swap.done
  399.  
  400. armor5:
  401. save 5
  402. var swap.armor armor5.skill
  403. put #statusbar 9 %armor5.skill
  404. if $%armor5.skill >= $swap.learningrate then goto armor5mindlock
  405. goto swap.done
  406.  
  407. armor5mindlock:
  408. put #math GH_ARMOR_COUNT add 1
  409. gosub swap.retreat
  410. gosub swap.retreat
  411. save 5
  412. if "%armor%s_head" != "nothing" then gosub remove head
  413. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  414. if "%armor%s_neck" != "nothing" then gosub remove neck
  415. if "%armor%s_torso" != "nothing" then gosub remove torso
  416. if "%armor%s_arms" != "nothing" then gosub remove arms
  417. if "%armor%s_hands" != "nothing" then gosub remove hands
  418. if "%armor%s_legs" != "nothing" then gosub remove legs
  419. pause .1
  420. if %armor6 = nothing then save 1
  421. else
  422. {
  423. save 6
  424. }
  425. if "%armor%s_head" != "nothing" then gosub armor.wear head
  426. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  427. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  428. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  429. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  430. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  431. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  432. var swap.armor armor%s.skill
  433. goto swap.done
  434.  
  435. armor6:
  436. save 6
  437. var swap.armor armor6.skill
  438. put #statusbar 9 %armor6.skill
  439. if $%armor6.skill >= $swap.learningrate then goto armor6mindlock
  440. goto swap.done
  441.  
  442. armor6mindlock:
  443. put #math GH_ARMOR_COUNT add 1
  444. gosub swap.retreat
  445. gosub swap.retreat
  446. save 6
  447. if "%armor%s_head" != "nothing" then gosub remove head
  448. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  449. if "%armor%s_neck" != "nothing" then gosub remove neck
  450. if "%armor%s_torso" != "nothing" then gosub remove torso
  451. if "%armor%s_arms" != "nothing" then gosub remove arms
  452. if "%armor%s_hands" != "nothing" then gosub remove hands
  453. if "%armor%s_legs" != "nothing" then gosub remove legs
  454. pause .1
  455. if %armor7 = nothing then save 1
  456. else
  457. {
  458. save 7
  459. }
  460. if "%armor%s_head" != "nothing" then gosub armor.wear head
  461. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  462. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  463. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  464. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  465. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  466. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  467. var swap.armor armor%s.skill
  468. goto swap.done
  469.  
  470. armor7:
  471. save 7
  472. var swap.armor armor7.skill
  473. put #statusbar 9 %armor7.skill
  474. if $%armor7.skill >= $swap.learningrate then goto armor7mindlock
  475. goto swap.done
  476.  
  477. armor7mindlock:
  478. put #math GH_ARMOR_COUNT add 1
  479. gosub swap.retreat
  480. gosub swap.retreat
  481. save 7
  482. if "%armor%s_head" != "nothing" then gosub remove head
  483. if "%armor%s_eyes" != "nothing" then gosub remove eyes
  484. if "%armor%s_neck" != "nothing" then gosub remove neck
  485. if "%armor%s_torso" != "nothing" then gosub remove torso
  486. if "%armor%s_arms" != "nothing" then gosub remove arms
  487. if "%armor%s_hands" != "nothing" then gosub remove hands
  488. if "%armor%s_legs" != "nothing" then gosub remove legs
  489. pause .1
  490. save 1
  491. if "%armor%s_head" != "nothing" then gosub armor.wear head
  492. if "%armor%s_eyes" != "nothing" then gosub armor.wear eyes
  493. if "%armor%s_neck" != "nothing" then gosub armor.wear neck
  494. if "%armor%s_torso" != "nothing" then gosub armor.wear torso
  495. if "%armor%s_arms" != "nothing" then gosub armor.wear arms
  496. if "%armor%s_hands" != "nothing" then gosub armor.wear hands
  497. if "%armor%s_legs" != "nothing" then gosub armor.wear legs
  498. var swap.armor armor1.skill
  499. goto swap.done
  500.  
  501. swap.done:
  502. put #statusbar 9 %armor%s.skill
  503. if %s = 1 then
  504. {
  505. put #math swap.learningrate add $swap.increaserate
  506. if $swap.learningrate > 33 then put #var swap.learningrate 33
  507. }
  508. counter set %gh.counter
  509. save %gh.save
  510. pause
  511. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement