Skip to content

Commit

Permalink
Merge pull request #15 from dhusemann/worknewcore
Browse files Browse the repository at this point in the history
Worknewcore
  • Loading branch information
dhusemann authored Jun 15, 2022
2 parents 51998ff + ba2fff2 commit 677fc19
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 28 deletions.
134 changes: 120 additions & 14 deletions IdleCombos.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include %A_ScriptDir%
#include JSON.ahk
#include idledict.ahk
;3.10
;add working core 4 and party 4 thanks Fmagdi
;hopeful fix for opening to many chest ban thanks deathoone
;support for huge contracts thanks NeyahPeterson
;3.00
;disabled log files by default
;2.00
Expand Down Expand Up @@ -51,7 +55,7 @@
;-(Also resized the window finally) :P

;Special thanks to all the idle dragons who inspired and assisted me!
global VersionNumber := "3.00"
global VersionNumber := "3.10"
global CurrentDictionary := "2.00"

;Local File globals
Expand Down Expand Up @@ -105,6 +109,9 @@ global BackgroundPatron := ""
global Background2Adventure := ""
global Background2Area := ""
global Background2Patron := ""
global Background3Adventure := ""
global Background3Area := ""
global Background3Patron := ""
global AchievementInfo := "This page intentionally left blank.`n`n`n`n`n`n`n"
global BlessingInfo := "`n`n`n`n`n`n"
global ChampDetails := ""
Expand Down Expand Up @@ -140,6 +147,7 @@ global BrivZone := 0
global FGCore := "`n`n"
global BGCore := "`n`n"
global BG2Core := "`n`n"
global BG3Core := "`n`n"
;Patron globals
global MirtVariants := ""
global MirtCompleted := ""
Expand Down Expand Up @@ -309,6 +317,7 @@ class MyGui {
;Menu, AdvSubmenu, Add, Load New BG Adv, LoadBGAdventure
Menu, AdvSubmenu, Add, End Background Adv, EndBGAdventure
Menu, AdvSubmenu, Add, End Background2 Adv, EndBG2Adventure
Menu, AdvSubmenu, Add, End Background3 Adv, EndBG3Adventure
Menu, AdvSubmenu, Add, &Kleho Image, KlehoImage
Menu, AdvSubmenu, Add, &Incomplete Variants, IncompleteVariants
Menu, AdvSubmenu, Add, Adventure List, AdventureList
Expand Down Expand Up @@ -376,10 +385,17 @@ class MyGui {
Gui, MyWindow:Add, Text, vBackground2Patron x+2 w50, % Background2Patron
Gui, MyWindow:Add, Text, x15 y+p w130, Background2 Area:
Gui, MyWindow:Add, Text, vBackground2Area x+2 w50, % Background2Area
Gui, MyWindow:Add, Text, x15 y162 w130, Background3 Adventure:
Gui, MyWindow:Add, Text, vBackground3Adventure x+2 w50, % Background3Adventure
Gui, MyWindow:Add, Text, x15 y+p w130, Background3 Patron:
Gui, MyWindow:Add, Text, vBackground3Patron x+2 w50, % Background3Patron
Gui, MyWindow:Add, Text, x15 y+p w130, Background3 Area:
Gui, MyWindow:Add, Text, vBackground3Area x+2 w50, % Background3Area

Gui, MyWindow:Add, Text, vFGCore x200 y33 w150, % FGCore
Gui, MyWindow:Add, Text, vBGCore x200 y76 w150, % BGCore
Gui, MyWindow:Add, Text, vBG2Core x200 y119 w150, % BG2Core
Gui, MyWindow:Add, Text, vBG3Core x200 y162 w150, % BG3Core

Gui, Tab, Inventory
Gui, MyWindow:Add, Text, x15 y33 w70, Current Gems:
Expand Down Expand Up @@ -515,9 +531,14 @@ class MyGui {
GuiControl, MyWindow:, Background2Adventure, % Background2Adventure, w250 h210
GuiControl, MyWindow:, Background2Area, % Background2Area, w250 h210
GuiControl, MyWindow:, Background2Patron, % Background2Patron, w250 h210
GuiControl, MyWindow:, Background3Adventure, % Background3Adventure, w250 h210
GuiControl, MyWindow:, Background3Area, % Background3Area, w250 h210
GuiControl, MyWindow:, Background3Patron, % Background3Patron, w250 h210

GuiControl, MyWindow:, FGCore, % FGCore, w250 h210
GuiControl, MyWindow:, BGCore, % BGCore, w250 h210
GuiControl, MyWindow:, BG2Core, % BG2Core, w250 h210
GuiControl, MyWindow:, BG3Core, % BG3Core, w250 h210
;inventory
GuiControl, MyWindow:, CurrentGems, % CurrentGems, w250 h210
GuiControl, MyWindow:, SpentGems, % SpentGems, w250 h210
Expand Down Expand Up @@ -1402,13 +1423,17 @@ Hg_Blacksmith:
return
}

global lastadv := 0 ;fmagdi - to be used to save ended adventureid for use as default for next load

LoadAdventure() {

GetUserDetails()
while !(CurrentAdventure == "-1") {
MsgBox, 5, , Please end your current adventure first.
IfMsgBox Cancel
return
}
advtoload := 592
advtoload := lastadv ;fmagdi - defaults to last ended adventure id, or to variable default in globals
patrontoload := 0
InputBox, advtoload, Adventure to Load, Please enter the adventure_id`nyou would like to load., , 250, 150, , , , , %advtoload%
if (ErrorLevel=1) {
Expand All @@ -1434,6 +1459,8 @@ Hg_Blacksmith:
}

EndAdventure() {
GetUserDetails() ;fmagdi - updates info before ending an adventure to be sure you are ending the correct one

while (CurrentAdventure == "-1") {
MsgBox, No current adventure active.
return
Expand All @@ -1443,6 +1470,9 @@ Hg_Blacksmith:
{
return
}

lastadv := CurrentAdventure ;fmagdi - saves ended adventure id for use as default when loading next adventure

advparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&game_instance_id=" ActiveInstance
sResult := ServerCall("softreset", advparams)
GetUserDetails()
Expand Down Expand Up @@ -1474,7 +1504,7 @@ Hg_Blacksmith:
}

EndBG2Adventure() {
if (ActiveInstance == "3") {
if (ActiveInstance == "3" or ActiveInstance == "4") {
bginstance := 2
}
else {
Expand All @@ -1496,6 +1526,30 @@ Hg_Blacksmith:
return
}

EndBG3Adventure() {
if (ActiveInstance == "4") {
bginstance := 3
}
else {
bginstance := 4
}
while (Background3Adventure == "-1" or Background3Adventure == "") {
MsgBox, No background3 adventure active.
return
}
MsgBox, 4, , % "Are you sure you want to end your background3 adventure ?`nParty: " bginstance " AdvID: " Background3Adventure " Patron: " Background3Patron
IfMsgBox, No
{
return
}
advparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&game_instance_id=" bginstance
sResult := ServerCall("softreset", advparams)
GetUserDetails()
SB_SetText("Background3 adventure has been ended.")
return
}
; fmagdi -stop

FirstRun() {
MsgBox, 4, , Get User ID and Hash from webrequestlog.txt?
IfMsgBox, Yes
Expand Down Expand Up @@ -1614,21 +1668,31 @@ Hg_Blacksmith:
BackgroundPatron := PatronFromID(v.current_patron_id)
bginstance += 1
}
else {
else if (bginstance == 1){
Background2Adventure := v.current_adventure_id
Background2Area := v.current_area
Background2Patron := PatronFromID(v.current_patron_id)
bginstance += 1
}
;
else if (bginstance == 2){
Background3Adventure := v.current_adventure_id
Background3Area := v.current_area
Background3Patron := PatronFromID(v.current_patron_id)
}

FGCore := "`n"
BGCore := "`n"
BG2Core := "`n"
If (ActiveInstance == 1) {
bginstance := 2
}
Else {
bginstance := 1
}
BG3Core := "`n"
; If (ActiveInstance == 1) {
; bginstance := 2
; }
; Else {
; bginstance := 1
; }

bginstance := 0

for k, v in UserDetails.details.modron_saves
if (v.instance_id == ActiveInstance) {
if (v.core_id == 1) {
Expand All @@ -1640,6 +1704,10 @@ Hg_Blacksmith:
else if (v.core_id == 3) {
FGCore := "Core: Fast"
}
else if (v.core_id == 4) {
FGCore := "Core: Magic"
}

if (v.properties.toggle_preferences.reset == true) {
FGCore := FGCore " (Reset at " v.area_goal ")"
}
Expand All @@ -1657,7 +1725,7 @@ Hg_Blacksmith:
percenttolevel := Floor((xptolevel / levelxp) * 100)
FGCore := FGCore "`nXP: " v.exp_total " (Lv " corelevel ")`n" xptolevel "/" levelxp " (" percenttolevel "%)"
}
else if (v.instance_id == bginstance and v.instance_id != 0) {
else if (bginstance == 0 and v.instance_id != 0) {
if (v.core_id == 1) {
BGCore := "Core: Modest"
}
Expand All @@ -1667,6 +1735,9 @@ Hg_Blacksmith:
else if (v.core_id == 3) {
BGCore := "Core: Fast"
}
else if (v.core_id == 4) {
BGCore := "Core: Magic"
}
if (v.properties.toggle_preferences.reset == true) {
BGCore := BGCore " (Reset at " v.area_goal ")"
}
Expand All @@ -1683,8 +1754,9 @@ Hg_Blacksmith:
}
percenttolevel := Floor((xptolevel / levelxp) * 100)
BGCore := BGCore "`nXP: " v.exp_total " (Lv " corelevel ")`n" xptolevel "/" levelxp " (" percenttolevel "%)"
bginstance += 1
}
else if(v.instance_id != 0){
else if (bginstance == 1 and v.instance_id != 0) {
if (v.core_id == 1) {
BG2Core := "Core: Modest"
}
Expand All @@ -1694,6 +1766,9 @@ Hg_Blacksmith:
else if (v.core_id == 3) {
BG2Core := "Core: Fast"
}
else if (v.core_id == 4) {
BG2Core := "Core: Magic"
}
if (v.properties.toggle_preferences.reset == true) {
BG2Core := BG2Core " (Reset at " v.area_goal ")"
}
Expand All @@ -1710,6 +1785,37 @@ Hg_Blacksmith:
}
percenttolevel := Floor((xptolevel / levelxp) * 100)
BG2Core := BG2Core "`nXP: " v.exp_total " (Lv " corelevel ")`n" xptolevel "/" levelxp " (" percenttolevel "%)"
bginstance += 1
}
else if(bginstance == 2 and v.instance_id != 0){
if (v.core_id == 1) {
BG3Core := "Core: Modest"
}
else if (v.core_id == 2) {
BG3Core := "Core: Strong"
}
else if (v.core_id == 3) {
BG3Core := "Core: Fast"
}
else if (v.core_id == 4) {
BG3Core := "Core: Magic"
}
if (v.properties.toggle_preferences.reset == true) {
BG3Core := BG3Core " (Reset at " v.area_goal ")"
}
xptolevel := v.exp_total
corelevel := 1
levelxp := 8000
while (xptolevel > (levelxp - 1)) {
corelevel += 1
xptolevel -= levelxp
levelxp += 4000
}
if (corelevel > 15) {
corelevel := corelevel " - Max 15"
}
percenttolevel := Floor((xptolevel / levelxp) * 100)
BG3Core := BG3Core "`nXP: " v.exp_total " (Lv " corelevel ")`n" xptolevel "/" levelxp " (" percenttolevel "%)"
}
;
}
Expand Down Expand Up @@ -2895,4 +3001,4 @@ while (clipContents ~= regexpPattern) {
}
foundCodeString := RegExReplace(foundCodeString, "`r`n$")
return foundCodeString
}
}
Loading

0 comments on commit 677fc19

Please sign in to comment.