Facebook
From Voltseon, 3 Years ago, written in Ruby.
Embed
Download Paste or View Raw
Hits: 512
  1. ################################################################################
  2. # Voltseon's Handy Tools
  3. # For more convenience
  4. ################################################################################
  5. #
  6. #
  7. # Written by: Voltseon
  8. # Credits not needed (But appreciated)
  9. # Made for people who dont want
  10. # to copy paste long scripts from
  11. # the Pokémon Essentials Wiki
  12. # Version: 1.2.1
  13. #
  14. ################################################################################
  15. #
  16. # Plugin Manager
  17. #
  18. ################################################################################
  19.  
  20. PluginManager.register({
  21.   :name => "Voltseon's Handy Tools",
  22.   :version => "1.2.1",
  23.   :credits => "Voltseon",
  24.   :link => "https://reliccastle.com/resources/400/",
  25. })
  26.  
  27. ################################################################################
  28. #
  29. # Changelog
  30. #
  31. ################################################################################
  32. #
  33. # v1.1 (29/07/2020) - Voltseon
  34. # - Added Alternate Methods for all existing methods
  35. # - The pbHasItem, pbItemQuantity and pbHasSpecies methods implemented.
  36. # - The -Silent() methods to add items and Pokemon silently added.
  37. # - A few more comments to help out the average joe
  38. # - I wish I had more to add here :(
  39. #
  40. #
  41. # v1.2 (06/08/2020) - Voltseon
  42. # - Added the ability to change a specific self switch
  43. # - Toggle Self Switches
  44. # - Toggle Global Switches
  45. # - Added the Manipulate player tab
  46. # - Set trainer gender & outfit
  47. # - Toggle trainer gender
  48. # - Toggle pokegear
  49. # - Toggle runningshoes
  50. # - Toggle pokedex & regiondex
  51. # - Fixed the Alternate Methods to have default values
  52. # - And put some more love into it <3
  53. #
  54. #
  55. # v1.2.1 (07/09/2020) - Voltseon
  56. # - Added the plugin manager used for v18
  57. # - Added an unnecessary extra decimal to the versions
  58. #
  59. ################################################################################
  60. #
  61. # Manipulating Items
  62. #
  63. ################################################################################
  64.  
  65. # Receive Item | Variables: itm = The Item, qty = Quantity of the item.
  66. def vRI(itm, qty=1)
  67. Kernel.pbReceiveItem(itm.upcase,qty)
  68. #Example: vRI("Potion",5) - The player receives 5 potions.
  69. #Alternates: vReceiveItem(), vItemReceive(), vGI(), vGetItem(), vItemGet()
  70. end
  71.  
  72. # Find Item | Variables: itm = The Item, qty = Quantity of the item.
  73. def vFI(itm, qty=1)
  74. Kernel.pbItemBall(itm.upcase,qty)
  75. #Example: vFI("Pokeball",5) - The player finds 5 pokéballs.
  76. #Alternates: vFindItem(), vItemFind(), vItemBall()
  77. end
  78.  
  79. # Delete Item | Variables: itm = The Item, qty = Quantity of the item.
  80. def vDI(itm, qty=1)
  81. $PokemonBag.pbDeleteItem(itm.upcase,qty)
  82. #Example: vDI("Keycard",2) - Deletes 2 keycards from the player.
  83. #Alternates: vDeleteItem(), vItemDelete(), vRemoveItem(), vItemRemove()
  84. end
  85.  
  86. # Add Item (Silently) | Variables: itm = The Item, qty = Quantity of the item.
  87. def vAI(itm, qty=1)
  88. $PokemonBag.pbStoreItem(itm.upcase,qty)
  89. #Example: vAI("Revive",5) - The player receives 5 revives, without a messagebox.
  90. #Alternates: vAddItem(), vAddItemSilent(), vItemAdd(), vItemSilent()
  91. end
  92.  
  93. # Item Quantity | Variables: itm = The Item
  94. def vIQ(itm)
  95. $PokemonBag.pbQuantity(itm.upcase)
  96. #Example: if vIQ("OranBerry") < 1 - Checks if the player has <1 Oran Berries.
  97. #Example 2: "Player has: #{vIQ("AirMail")} Air mails in their bag.
  98. #Alternates: vItemQuantity(), vQuantityItem()
  99. end
  100.  
  101. # Has Item | Variables: itm = The Item
  102. def vHI(itm)
  103. $PokemonBag.pbHasItem?(itm.upcase)
  104. #Example: if vHI("Protector") - Checks if the player has a Protector.
  105. #Alternatives: vHasItem()
  106. end
  107.  
  108. ################################################################################
  109. #
  110. # Manipulating Pokemon
  111. #
  112. ################################################################################
  113.  
  114. # Give Pokémon | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  115. def vGP(pok, lvl)
  116. pbAddPokemon(pok.upcase,lvl)
  117. #Example: vGP("Pikachu",5) - Gives the player a level 5 Pikachu.
  118. #Alternatives: vGivePokemon()
  119. end
  120.  
  121. # Add Pokémon | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  122. def vAP(pok, lvl)
  123. pbAddToParty(pok.upcase,lvl)
  124. #Example: vAP("Lotad",10) - Gives the player a level 10 Lotad.
  125. #Different from Give Pokémon: Adds it to your party instead of sending it to your PC.
  126. #Alternatives: vAddPokemon()
  127. end
  128.  
  129. # Receive Pokémon | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  130. # from = The NPC's name, nick = Pokémon's nickname
  131. # gen = Gender of the NPC: 0=male 1=female 2=unknown
  132. def vRP(pok, lvl, from, nick, gen=0)
  133. pbAddForeignPokemon(pok.upcase,lvl,from,nick,gen)
  134. #Example: vRP("Dunsparce",50,"Volt","Seon",2) - Receives a Level 50 Dunsparce from Volt called Seon, Volt is unkown gender.
  135. #Alternatives: vReceivePokemon()
  136. end
  137.  
  138. # Delete Pokémon | Variables: i = index.
  139. def vDP(i=0)
  140. pbRemovePokemonAt(i)
  141. #Example: vDP(1) - Removes the 2nd Pokémon in the party.
  142. #Alternatives: vDeletePokemon(), vRemovePokemon()
  143. end
  144.  
  145. # Give Pokémon Silent | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  146. def vGPS(pok, lvl)
  147. pbAddPokemonSilent(pok.upcase,lvl)
  148. #Example: vGPS("Pikachu",5) - Gives the player a level 5 Pikachu silently.
  149. #Alternatives: vGivePokemonSilent()
  150. end
  151.  
  152. # Add Pokémon Silent | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  153. def vAPS(pok, lvl)
  154. pbAddToPartySilent(pok.upcase,lvl)
  155. #Example: vAPS("Lotad",10) - Gives the player a level 10 Lotad silently.
  156. #Alternatives: vAddPokemonSilent()
  157. end
  158.  
  159. # Has Pokemon | Variables: pok = The Pokemon
  160. def vHP(pok)
  161. pbHasSpecies?(pok.upcase)
  162. #Example: if vHP("Jirachi") - Returns true if the player has a Jirachi
  163. #Alternatives: vHasPokemon(), vHS(), vHasSpecies()
  164. end
  165.  
  166. ################################################################################
  167. #
  168. # Battles
  169. #
  170. ################################################################################
  171.  
  172. # Wild Battle | Variables: pok = The Pokemon, lvl = Level of the Pokemon.
  173. # rslt = Game Variable in which the outcome will be recorded: 1=won 2=lost 3=run 4=caught 5=draw.
  174. # escp = if you can run away from the battle.
  175. # lose = if you can lose the battle or black out.
  176. def vWB(pok,lvl,rslt=0,escp=true,lose=false)
  177. pbWildBattle(pok.upcase,lvl,rslt,escp,lose)
  178. #Example: vWB("Nosepass",10,5,true,false) - Battles a level 10 Nosepass that you cannot lose but can escape and result is stored in variable 5.
  179. #Alternatives: vWildBattle()
  180. end
  181.  
  182. # Trainer Battle | Variables: cls = Trainer Class, nam = Trainer Name.
  183. # mes = Lose message, dbl = Is it a double battle?
  184. # trn = Trainer Number, cnt = Can you continue?
  185. # out = Game Variable in which the outcome will be stored.
  186. def vTB(cls,nam,mes="...",dbl=false,trn=0,cnt=false,out=0)
  187. pbTrainerBattle(cls.upcase,nam,mes,dbl,trn,cnt,out)
  188. #Example: vTB("Camper","Liam","Darn!",false,1,true,2) - Battles Camper Liam #1 who says "Darn!" after he loses, that you can lose and result is stored in variable 2.
  189. #Alternatives: vTrainerBattle()
  190. end
  191.  
  192. ################################################################################
  193. #
  194. # Manipulate Player
  195. #
  196. ################################################################################
  197.  
  198. # Set outfit | Variables: i = Index, outfit number
  199. def vO(i=0)
  200. $Trainer.outfit=i
  201. #Example: vO(5) - Sets the outfit to outfit 5 (trchar000_5)
  202. #Alternatives: vOutfit(), vSO(), vSetOutfit()
  203. end
  204.  
  205. # Set gender | Variables: i = Index, gender number (0=Male, 1=Female)
  206. def vG(i=0)
  207. pbChangePlayer(i)
  208. #Example: vG(1) - Sets the player gender to 1 (Female)
  209. #Alternatives: vGender(), vSG(), vSetGender()
  210. end
  211.  
  212. # Toggle gender | Variables: none
  213. def vTG()
  214. i=(pbGetTrainerTypeGender($Trainer.trainertype)-1).abs
  215. pbChangePlayer(i)
  216. #Example: vTG() - Toggles the player gender
  217. #Alternatives: vToggleGender()
  218. end
  219.  
  220. # Toggle Region Dex | Variables: i = Index, dex number
  221. def vTRD(i=0)
  222. if $PokemonGlobal.pokedexUnlocked == true
  223. pbLockDex(i)
  224. else
  225. pbUnlockDex(i)
  226. end
  227. #Example: vTRD(0) - Toggles the region dex #0
  228. #Alternatives: vToggleRegionDex()
  229. end
  230.  
  231. # Toggle Pokedex | Variables: none
  232. def vTPD()
  233. $Trainer.pokedex = !$Trainer.pokedex
  234. #Example: vTPD() - Toggles the pokegear
  235. #Alternatives: vTogglePokedex(), vTogglePokeDex()
  236. end
  237.  
  238. # Toggle Running Shoes | Variables: none
  239. def vTRS()
  240. $PokemonGlobal.runningShoes = !$PokemonGlobal.runningShoes
  241. #Example: vTRS() - Toggles the runningshoes
  242. #Alternatives: vToggleRunningShoes(), vRS(), vRunningShoes()
  243. end
  244.  
  245. # Toggle Pokegear | Variables: none
  246. def vTPG()
  247. $Trainer.pokegear = !$Trainer.pokegear
  248. #Example: vTPG() - Toggles the pokegear
  249. #Alternatives: vTogglePokegear(), vTogglePokeGear()
  250. end
  251. ################################################################################
  252. #
  253. # Miscellaneous
  254. #
  255. ################################################################################
  256.  
  257. # Play Cry | Variables: i = Index, the National Number of the Pokémon
  258. # vol = Volume, pch = Pitch
  259. def vCry(i,vol=80,pch=100)
  260. cry=pbCryFile(i)
  261. pbSEPlay(cry,80,100)
  262. #Example: vCry(25,120,50) - Plays Pikachu's Cry at 120% volume and 50% pitch.
  263. #Alternatives: vPlayCry(), vPC()
  264. end
  265.  
  266. # Set Selfswitch = True | Variables: i = Index, Event Number & swt = Switch
  267. def vSS(i,swt="A")
  268. pbSetSelfSwitch(i,swt,true)
  269. #Example: vSS(5,"C") - Sets Self Switch C of Event #5 to true
  270. #Alternatives: vSST(), vSSt(), vSetSelfSwitch(), vSetSelfSwitchTrue()
  271. end
  272.  
  273. # Set Selfswitch = False | Variables: i = Index, Event Number & swt = Switch
  274. def vSSF(i,swt="A")
  275. pbSetSelfSwitch(i,swt,false)
  276. #Example: vSSF(2,"B") - Sets Self Switch B of Event #2 to false
  277. #Alternatives: vSSf(), vSetSelfSwitchFalse()
  278. end
  279.  
  280. # Toggle Selfswitch | Variables: i = Index, Event Number & evt = Event ID
  281. def vTSS(evt=@event_id,i="A")
  282. $game_self_switches[[$game_map.map_id,evt,i]]=!$game_self_switches[[$game_map.map_id,evt,i]]
  283. $game_map.need_refresh = true
  284. #Example: vTSS(5,"C") - Toggles Self Switch C of Event #5
  285. #Alternatives: vtSS(), vToggleSelfSwitch()
  286. end
  287.  
  288. # Toggle Global Switch | Variables: i = Index
  289. def vTGS(i)
  290. $game_switches=!$game_switches
  291. $game_map.need_refresh = true
  292. #Example: vTGS(50) - Toggles Global Switch #50
  293. #Alternatives: vtGS(), vTS(), vToggleGlobalSwitch(), vToggleGameSwitch(), vToggleSwitch()
  294. end
  295.  
  296. # Toggle Selfswitch in Range | Variables: swt = Switch, min & max = range
  297. def vTSSR(swt,min,max)
  298. i=min
  299. while i <= max
  300. vTSS(i,swt)
  301. i+=1
  302. end
  303. #Example: vTSSR("A",5,15) - Toggles Self Switch "A" for event 5 through 15
  304. #Alternatives: vToggleSelfSwitchRange(), vRTSS(), vRangeToggleSelfSwitch()
  305. end
  306. ################################################################################
  307. #
  308. # Alternate Methods
  309. #
  310. ################################################################################
  311. #
  312. # You can ignore these methods as they do not have any comments explaining them
  313. # These are here in case you prefer to use for example:
  314. # vReceiveItem over vRI, just in case
  315. # All of these methods use vA,vB,vC... as their input, they dont mean anything
  316. # They are just indexes. If you are interested in adding your own methods,
  317. # Go ahead, it's free, but don't forget to re-add them when updating the script
  318. # <3 Voltseon
  319. #
  320. # In case these alternate methods are in the way when scrolling through
  321. # the script, I recommend you put these in another seperate section
  322. # !But dont forget to update the Alternate Methods when doing that!
  323. #
  324. ################################################################################
  325.  
  326. #Item Manipulation
  327. def vReceiveItem(vA, vB=1)
  328. vRI(vA, vB)
  329. end
  330.  
  331. def vItemReceive(vA, vB=1)
  332. vRI(vA, vB)
  333. end
  334.  
  335. def vGI(vA, vB=1)
  336. vRI(vA, vB)
  337. end
  338.  
  339. def vGetItem(vA, vB=1)
  340. vRI(vA, vB)
  341. end
  342.  
  343. def vItemGet(vA, vB=1)
  344. vRI(vA, vB)
  345. end
  346.  
  347. def vFindItem(vA, vB=1)
  348. vFI(vA, vB)
  349. end
  350.  
  351. def vItemFind(vA, vB=1)
  352. vFI(vA, vB)
  353. end
  354.  
  355. def vItemBall(vA, vB=1)
  356. vFI(vA, vB)
  357. end
  358.  
  359. def vDeleteItem(vA, vB=1)
  360. vDI(vA, vB)
  361. end
  362.  
  363. def vItemDelete(vA, vB=1)
  364. vDI(vA, vB)
  365. end
  366.  
  367. def vRemoveItem(vA, vB=1)
  368. vDI(vA, vB)
  369. end
  370.  
  371. def vItemRemove(vA, vB=1)
  372. vDI(vA, vB)
  373. end
  374.  
  375. def vAddItem(vA, vB=1)
  376. vAI(vA, vB)
  377. end
  378.  
  379. def vAddItemSilent(vA, vB=1)
  380. vAI(vA, vB)
  381. end
  382.  
  383. def vItemAdd(vA, vB=1)
  384. vAI(vA, vB)
  385. end
  386.  
  387. def vItemSilent(vA, vB=1)
  388. vAI(vA, vB)
  389. end
  390.  
  391. def vAddItem(vA, vB=1)
  392. vAI(vA, vB)
  393. end
  394.  
  395. def vItemQuantity(vA)
  396. vIQ(vA)
  397. end
  398.  
  399. def vQuantityItem(vA)
  400. vIQ(vA)
  401. end
  402.  
  403. def vHasItem(vA)
  404. vHI(vA)
  405. end
  406.  
  407. #Pokemon Manipulation
  408. def vGivePokemon(vA, vB)
  409. vGP(vA, vB)
  410. end
  411.  
  412. def vAddPokemon(vA, vB)
  413. vAP(vA, vB)
  414. end
  415.  
  416. def vGivePokemonSilent(vA, vB)
  417. vGPS(vA, vB)
  418. end
  419.  
  420. def vAddPokemonSilent(vA, vB)
  421. vAPS(vA, vB)
  422. end
  423.  
  424. def vReceivePokemon(vA, vB, vC, vD, vE=0)
  425. vRP(vA, vB, vC, vD, vE)
  426. end
  427.  
  428. def vDeletePokemon(vA)
  429. vDP(vA)
  430. end
  431.  
  432. def vRemovePokemon(vA)
  433. vDP(vA)
  434. end
  435.  
  436. def vHasPokemon(vA)
  437. vHP(vA)
  438. end
  439.  
  440. def vHS(vA)
  441. vHP(vA)
  442. end
  443.  
  444. def vHasSpecies(vA)
  445. vHP(vA)
  446. end
  447.  
  448. #Battles
  449. def vWildBattle(vA, vB, vC=0, vD=true, vE=false)
  450. vWB(vA, vB, vC, vD, vE)
  451. end
  452.  
  453. def vTrainerBattle(vA, vB, vC, vD=false, vE=0, vF=false, vG=0)
  454. vTB(vA, vB, vC, vD, vE, vF, vG)
  455. end
  456.  
  457. #Player
  458. def vOutfit(vA)
  459. vO(vA)
  460. end
  461.  
  462. def vSO(vA)
  463. vO(vA)
  464. end
  465.  
  466. def vSetOutfit(vA)
  467. vO(vA)
  468. end
  469.  
  470. def vGender(vA)
  471. vG(vA)
  472. end
  473.  
  474. def vSG(vA)
  475. vG(vA)
  476. end
  477.  
  478. def vSetGender(vA)
  479. vG(vA)
  480. end
  481.  
  482. def vToggleGender()
  483. vTG()
  484. end
  485.  
  486. def vToggleRegionDex(vA)
  487. vTRD(vA)
  488. end
  489.  
  490. def vTogglePokedex()
  491. vTP()
  492. end
  493.  
  494. def vTogglePokeDex()
  495. vTP()
  496. end
  497.  
  498. def vToggleRunningShoes()
  499. vTRS()
  500. end
  501.  
  502. def vRS()
  503. vTRS()
  504. end
  505.  
  506. def vRunningShoes()
  507. vTRS()
  508. end
  509.  
  510. def vTogglePokegear()
  511. vTPG()
  512. end
  513.  
  514. def vTogglePokeGear()
  515. vTPG()
  516. end
  517.  
  518. #Miscellaneous
  519. def vPC(vA, vB=80, vC=100)
  520. vCry(vA, vB, vC)
  521. end
  522.  
  523. def vPlayCry(vA, vB=80, vC=100)
  524. vCry(vA, vB, vC)
  525. end
  526.  
  527. def vSST(vA, vB="A")
  528. vSS(vA, vB)
  529. end
  530.  
  531. def vSSt(vA, vB="A")
  532. vSS(vA, vB)
  533. end
  534.  
  535. def vSetSelfSwitch(vA, vB="A")
  536. vSS(vA, vB)
  537. end
  538.  
  539. def vSetSelfSwitchTrue(vA, vB="A")
  540. vSS(vA, vB)
  541. end
  542.  
  543. def vSetSelfSwitchFalse(vA, vB="A")
  544. vSSF(vA, vB)
  545. end
  546.  
  547. def vSSf(vA, vB="A")
  548. vSSF(vA, vB)
  549. end
  550.  
  551. def vtSS(vA, vB="A")
  552. vTSS(vA, vB)
  553. end
  554.  
  555. def vToggleSelfSwitch(vA, vB="A")
  556. vTSS(vA, vB)
  557. end
  558.  
  559. def vtGS(vA)
  560. vTGS(vA)
  561. end
  562.  
  563. def vTS(vA)
  564. vTGS(vA)
  565. end
  566.  
  567. def vToggleGlobalSwitch(vA)
  568. vTGS(vA)
  569. end
  570.  
  571. def vToggleGameSwitch(vA)
  572. vTGS(vA)
  573. end
  574.  
  575. def vTS(vA)
  576. vTGS(vA)
  577. end
  578.  
  579. def vToggleSelfSwitchRange(vA, vB, vC)
  580. vTSSR(vA, vB, vC)
  581. end
  582.  
  583. def vRTSS(vA, vB, vC)
  584. vTSSR(vA, vB, vC)
  585. end
  586.  
  587. def vRangeToggleSelfSwitch(vA, vB, vC)
  588. vTSSR(vA, vB, vC)
  589. end

Replies to Voltseon's Handy Tools (v1.2.1) rss

Title Name Language When
Re: Voltseon's Handy Tools (v1.2.1) Soft Coyote ruby 1 Year ago.
Re: Voltseon's Handy Tools (v1.2.1) Capacious Octupus ruby 1 Year ago.
Re: Voltseon's Handy Tools (v1.2.1) Trivial Crocodile ruby 3 Years ago.