Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; #### Raise Pokemon level ####
- ; Trainer Pokemon & Wild Pokemon
- ; == Description ==
- ; you can set your own percentage values, edit variables 'p1'-'p6' or 'percent'
- ; Alt + 1 for raising trainer pokemon levels
- ; Alt + 2 for raising wild pokemon levels
- ; Shift + 0 tells the script to stop, in order to continue hit Ctrl + Shift + 0 and the corresponding shortcut again (Alt + 1 or Alt + 2)
- ; == Usage ==
- ; - Trainers -
- ; 1) open 'Trainer Editor', select first trainer where you want to start
- ; 2) hit Alt + 1 to start automatic routine of raising pokemon levels of ALL trainers
- ; 3) hit Shift + 0 (spam it, works better) as soon as the last trainer is being edited
- ; ATTENTION: the script will keep going until you manually stop it. If it reaches the last trainer in the list,
- ; it will continue to raise his pokemon levels infinitely (until all are 100)
- ; - Wild Pokemon -
- ; 1) open 'Wild Pokemon Editor'
- ; 2) hit Alt + 2 to start automatic routine of raising ALL wild pokemon levels
- ; 3) hit Shift + 0 (spam it, works better) as soon as the last area is being edited
- ; ATTENTION: the script will keep going until you manually stop it. If it reaches the last area in the list,
- ; it will continue to raise the pokemon levels infinitely (until all are 100)
- ; set default values
- defValTrainer := 20
- defValWild := 23
- i := 1
- Loop, 6
- {
- p%i% := defValTrainer
- i := i + 1
- }
- pWild := defValWild
- ; ==== GUI ====
- Gui, Add, GroupBox, x12 y110 w240 h200 , raise levels by `% depending on team size
- Gui, Font, S12, Verdana
- Gui, Add, Text, x202 y130 w20 h20 , `%
- Gui, Add, Text, x202 y160 w20 h20 , `%
- Gui, Add, Text, x202 y190 w20 h20 , `%
- Gui, Add, Text, x202 y220 w20 h20 , `%
- Gui, Add, Text, x202 y250 w20 h20 , `%
- Gui, Add, Text, x202 y280 w20 h20 , `%
- Gui, Add, Text, x202 y320 w20 h20 , `%
- Gui, Font, S10, Verdana
- Gui, Add, Text, x12 y10 w240 h90 , Set your custom percentage values. You can set different values for different team sizes. The entire opponent's team is raised by the percentage you enter.
- Gui, Add, Text, x22 y130 w120 h20 , has 1 Pokemon
- Gui, Add, Text, x22 y160 w120 h20 , has 2 Pokemon
- Gui, Add, Text, x22 y190 w120 h20 , has 3 Pokemon
- Gui, Add, Text, x22 y220 w120 h20 , has 4 Pokemon
- Gui, Add, Text, x22 y250 w120 h20 , has 5 Pokemon
- Gui, Add, Text, x22 y280 w120 h20 , has 6 Pokemon
- Gui, Add, Text, x22 y320 w120 h20 , wild Pokemon
- Gui, Add, Edit, x152 y130 w40 h20 vp1, %p1%
- Gui, Add, Edit, x152 y160 w40 h20 vp2, %p2%
- Gui, Add, Edit, x152 y190 w40 h20 vp3, %p3%
- Gui, Add, Edit, x152 y220 w40 h20 vp4, %p4%
- Gui, Add, Edit, x152 y250 w40 h20 vp5, %p5%
- Gui, Add, Edit, x152 y280 w40 h20 vp6, %p6%
- Gui, Add, Edit, x152 y320 w40 h20 vpWild, %pWild%
- Gui, Add, Button, x152 y350 w70 h30, Help
- Gui, Add, Button, x42 y350 w80 h30, OK
- ; Generated using SmartGUI Creator 4.0
- Gui, Show, xCenter yCenter h402 w267, Automatic Level Raising
- Return
- ButtonHelp:
- MsgBox,, Help, == Usage ==`n- Trainers -`n1) open 'Trainer Editor' in Spiky's DS Map Editor, select first trainer where you want to start`n2) hit Alt + 1 to start automatic routine of raising Pokemon levels of ALL trainers`n3) hit Shift + 0 (spam it, works better) as soon as the last trainer is being edited`n`n- Wild Pokemon -`n1) open 'Wild Pokemon Editor' in Spiky's DS Map Editor`n2) hit Alt + 2 to start automatic routine of raising ALL wild Pokemon levels`n3) hit Shift + 0 (spam it, works better) as soon as the last area is being edited`n`nATTENTION: the script will keep going until you manually stop it. If it reaches the last trainer/wild Pokemon area in the list, it will continue to raise the Pokemon levels infinitely (until all are 100)`n`n== Hotkeys ==`nAlt + 1 - raise trainer's Pokemon levels`nAlt + 2 - raise wild Pokemon levels`nAlt + 3 - check the currently set and active percentage values`nShift + 0 - stop script `nCtrl + Shift + 0 - continue script (press Alt + 1 or Alt + 2 again)`n`nAfter you have set your values, hit OK to submit them. Afterwards, you can use the hotkeys in Spiky's DS Map Editor.
- return
- ButtonOK:
- Gui, Submit, NoHide
- ; set default values if empty strings were submitted
- defaultSetNote := ""
- submittedEmpty := false
- ; Pokemon 1-6
- i := 1
- Loop, 6
- {
- if (p%i% = "")
- {
- p%i% := defValTrainer
- submittedEmpty := true
- }
- i := i + 1
- }
- ; wild Pokemon
- if (pWild = "")
- {
- pWild := defValWild
- submittedEmpty := true
- }
- if (submittedEmpty)
- defaultSetNote := "NOTE: You submitted empty values, they were set to the default value!`n`n"
- MsgBox,, Values set!, %defaultSetNote%You're set!`nPress the hotkeys (Alt + 1 or Alt + 2) in Spiky's DS Map Editor`nto start the automatic routine!
- return
- GuiClose:
- ExitApp
- ; ==== GUI end ====
- ; === Script ===
- ; 'clipboard' is a reserved global variable from AutoHotkey that contains the current clipboard value
- ; sleep (wait in milliseconds) in between certain steps works better
- stop := false
- ; Shift + 0 - stop
- +0::stop := true
- ; Ctrl + Shift + 0 - continue
- ^+0::stop := false
- ; Alt + 3 - check active/set percentage values
- !3::
- MsgBox,, Value Check, has 1 PKMN: %p1%`%`nhas 2 PKMN: %p2%`%`nhas 3 PKMN: %p3%`%`nhas 4 PKMN: %p4%`%`nhas 5 PKMN: %p5%`%`nhas 6 PKMN: %p6%`%`nWild Pokemon: %pWild%`%
- return
- ; Alt + 1 - raise trainer pokemon levels
- !1::
- if WinActive("ahk_exe SDSME.exe")
- {
- ; raise pokemon levels by percentage, depending on how many pokemon a trainer has (allows more fine tuning)
- while !stop
- {
- pokeCount := countPokemon()
- percent := p%pokeCount% ; get according percentage value dynamically
- ;percent := 20 ; set static percentage value for all cases equally
- Loop, %pokeCount%
- {
- addTrainerLevel(percent) ; raise levels
- sleep, 25
- if (pokeCount > 1)
- {
- nextPokemon() ; select next pokemon
- sleep, 25
- }
- }
- saveTrainer()
- sleep, 25
- nextTrainer()
- sleep, 50
- }
- }
- return
- ; Alt + 2 - raise wild pokemon levels
- !2::
- if WinActive("ahk_exe SDSME.exe")
- {
- X := 460
- while !stop
- {
- Y := 123
- Loop, 12 ; always 12
- {
- addWildLevel(pWild, X, Y)
- Y := Y + 27
- sleep, 10
- }
- saveWild()
- sleep, 25
- nextArea()
- }
- }
- return
- ; get current level and add percentage
- addWildLevel(percent, X, Y)
- {
- Click %X%, %Y%, 2 ; double click
- sleep, 25
- Send, ^c ; copy current level into clipboard
- sleep, 25
- cache := clipboard
- ; always round up
- result := ceil(cache * (percent / 100)) + cache
- clipboard := result
- sleep, 25
- Send, ^v ; paste new level from clipboard
- }
- ; select next area in 'Wild Pokemon Editor'
- nextArea()
- {
- Click 135, 50
- sleep, 25
- send, {down}
- sleep, 25
- send, {enter}
- sleep, 25
- }
- ; counts trainer pokemon by clicking through pokemon tabs
- ; returns pokemon amount
- countPokemon()
- {
- pokemon := 0
- exists := true
- X := 22
- while exists
- {
- exists := pokemonExists(X, 215)
- if (exists)
- pokemon := pokemon + 1
- X := X + 66
- }
- Click 50, 215 ; click on first pokemon tab of trainer
- return pokemon
- }
- ; checks if a pokemon tab exists at X, Y coordinates by checking color at mouse position after clicking
- ; white = exists, any other color = doesn't exist
- pokemonExists(X, Y)
- {
- ret := false
- Click %X%, %Y%
- PixelGetColor color, X, Y
- if (color = "0xFFFFFF") ; = white
- ret := true
- sleep, 10
- return ret
- }
- ; get current level and add percentage
- addTrainerLevel(percent)
- {
- Click 175, 255, 2 ; double click
- sleep, 25
- Send, ^c ; copy current level into clipboard
- sleep, 25
- cache := clipboard
- ; always round up
- result := ceil(cache * (percent / 100)) + cache
- clipboard := result
- sleep, 25
- Send, ^v ; paste new level from clipboard
- }
- ; select next pokemon
- nextPokemon()
- {
- send, {LCtrl down} {Tab} {LCtrl up} ; send Ctrl + Tab
- }
- ; click 'Trainer Editor' save button
- saveTrainer()
- {
- Click 390, 350
- sleep, 25
- Click 390, 350 ; click save button 2 times with a small delay, works better
- }
- ; click 'Wild Pokemon Editor' save button
- saveWild()
- {
- Click 800, 520
- sleep, 25
- Click 800, 520 ; click save button 2 times with a small delay, works better
- }
- ; select next trainer
- nextTrainer()
- {
- Click 195, 50
- sleep, 25
- send, {down}
- sleep, 25
- send, {enter}
- sleep, 25
- Click 50, 215 ; click on first pokemon tab of trainer
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement