Compare commits

...

113 Commits
dev ... master

Author SHA1 Message Date
sigonasr2 03b405afb7 Fix domain URL pointers. 5 years ago
sigonasr2 fad14b1843 Bugfix when monitor adjustments or switching occurs, nulling out the 5 years ago
sigonasr2 71e9a6872c Add in current game playing display back to Twitch module. 5 years ago
sigonasr2 38c3a9bdfd Fixed issues with modules not saving through Modules submenu. 5 years ago
sigonasr2 c12d3b0aa5 Forced config file to save when toggling modules on and off. 5 years ago
sigonasr2 fbf8e5d087 Added retry timer check to avoid Lost Connection messages constantly. 5 years ago
sigonasr2 39e97b685f Changed property keys 5 years ago
sigonasr2 bfd9aec010 config file bugfix 5 years ago
sigonasr2 369bbcfcc8 Add options to config file. 5 years ago
sigonasr2 7bbb7655ea Added follower name color config options. 5 years ago
sigonasr2 eedb9f7720 Fix Twitch Module breaking if stream is offline. 5 years ago
sigonasr2 6bbfb0beb4 Update jar 5 years ago
sigonasr2 8f6015f9b1 The Module Selector Window should not be visible by default. 5 years ago
sigonasr2 427c4804a2 Updated sigIRCv2 to use new Twitch API features. Follower and twitch 5 years ago
sigonasr2 64cc36cd32 Rabi-Race is being fun right now and Trimead keeps talking about random 5 years ago
sigonasr2 9c506f0a56 fdsafopkdap 5 years ago
sigonasr2 59bc0deee7 Sleepy bun is sleepy 5 years ago
sigonasr2 eb51d38a3d Changed synced values. 5 years ago
sigonasr2 6c2f718146 Add new sync restrictions. 5 years ago
sigonasr2 63e10d1fe0 Reversed logic. 5 years ago
sigonasr2 91603a9361 Properly track and handle bosses. 5 years ago
sigonasr2 6ddca772de Make non-coop work again. 5 years ago
sigonasr2 d469cc4b19 Actually update the event value. 5 years ago
sigonasr2 06c8852851 Try different darkness detection method. 5 years ago
sigonasr2 ed9d23771a fix conflict with death event sync settings. 5 years ago
sigonasr2 8513d7ec02 Add missing event values when parsed. 5 years ago
sigonasr2 234fa59014 ??????? 5 years ago
sigonasr2 d83c522836 Correct value parsing errors. 5 years ago
sigonasr2 d56ba568c7 Add unsyncing red text color indicator. 5 years ago
sigonasr2 748c549b6f Changed Sync requirements for specific events. 5 years ago
sigonasr2 fb83cfd850 Rabi Race Sync and update processes now do not clash. 5 years ago
sigonasr2 2bd5806eca Update event structures to rely on in-client data values as reference 5 years ago
sigonasr2 9f89675334 Account for events that need to be completed (boss fights) 5 years ago
sigonasr2 c95db007fb Stability Update. 5 years ago
sigonasr2 68869f58a5 Fix parsing of non-event values. 5 years ago
sigonasr2 d23564b8ed Changed valid value check from 23->22. 5 years ago
sigonasr2 fd17b8e924 update jar. 5 years ago
sigonasr2 838d1bf4d1 update jar. 5 years ago
sigonasr2 b0790d5dc6 Updated. 5 years ago
sigonasr2 917052bd08 Updated. 5 years ago
sigonasr2 e3b83f1d76 Changed debugging and added revival steps. 5 years ago
sigonasr2 35463e723f Added even more debug messages. 5 years ago
sigonasr2 429dad38fb Add more debugging. 5 years ago
sigonasr2 fafad3f6b9 Add debugging messages 5 years ago
sigonasr2 cb8b325578 Update jar. 5 years ago
sigonasr2 36e5899549 Trying different Title screen offset. 5 years ago
sigonasr2 c4b28ebeba Updated Title screen value. Added location tracking on profiles. Changed 5 years ago
sigonasr2 adef5e93f6 Fix excessive green plusses. 5 years ago
sigonasr2 0a85e34e46 Update with some bugfixes. 5 years ago
sigonasr2 a990c6b876 Added new map marking features. Ribbon does not get added if you are 5 years ago
sigonasr2 09efab570e Updated jar 5 years ago
sigonasr2 922795b9cf Found a better title screen memory value. Everything looks good. Pillar. 5 years ago
sigonasr2 63e055a278 Updated jar and title screen value. Ignore ribbon event. 5 years ago
sigonasr2 ae8d212d0b Added notifications to Rabi Race. 5 years ago
sigonasr2 3a93e0a3b8 Update jar 5 years ago
sigonasr2 cff7ca4683 Added Event Syncing 5 years ago
sigonasr2 a77a442a76 Check for Coop mode. 5 years ago
sigonasr2 172482beda Fix NullPointer for syncing items with other players. 5 years ago
sigonasr2 0644cd10a7 Improve and fix data internals for health/mana/pack/regen/attack ups. 5 years ago
sigonasr2 c0e653e31c SigIRC Rabi Race updates - should be stable. 5 years ago
sigonasr2 4d1f82d3e8 Rabi-Race bugfixes, title screen pausing enabled. 5 years ago
sigonasr2 9b0e9ee189 Sync fixes. 5 years ago
sigonasr2 bfd65c1af1 Updated Rabi Race with new coop features. Still have to fix some issues. 5 years ago
sigonasr2 317ecb95e0 More spaghetti code fixes and things. 6 years ago
sigonasr2 397403d8c2 Update Bandori module. 6 years ago
sigonasr2 3ebdd94951 Removed/Added window controls based on if "showWindowControls" option 6 years ago
sigonasr2 bd7a76a06f Re-commit sigIRCv2 6 years ago
sigonasr2 4d26cc9a98 Fix originating username sending initialization issue. 6 years ago
sigonasr2 1d4182df2a Fix issue with identifying downloaded profiles from web server. (Being 6 years ago
sigonasr2 83d1cc2f3a Fix loading of incompatible profile versions. (Old versions) 6 years ago
sigonasr2 0d54a07390 Updated Rabi Race module to be compatible with v1.99s of Rabi-Ribi. 6 years ago
sigonasr2 2e0086dcb9 Fix word triggers and reference new emotes. 6 years ago
sigonasr2 e2412fd801 Remove connection call to Bandori.party/api 6 years ago
sigonasr2 df9194297b Update all event stamps up to current event. 6 years ago
sigonasr2 ecc303f0cd Fix Song Title display. 6 years ago
sigonasr2 3f67b7973b Add in SongProgress functionality. 6 years ago
sigonasr2 0ff41e0cc7 Update sigIRC jar. Remove image handling 6 years ago
sigonasr2 aca531d273 Update Bandori Module with new Lisa stamp. 6 years ago
sigonasr2 bd1f339c87 Fix issue with writing to non-existent directory due to extra stamps 6 years ago
sigonasr2 b81a87b449 Add in new emote "The Fruits of Our Labor" for Eve. 6 years ago
sigonasr2 a2f3664da3 Fix emotes not being vertically centered. 6 years ago
sigonasr2 01f4d1c261 Added proper UTF-8 encoding support for messages. Increased size of 6 years ago
sigonasr2 d082fb3191 Add new Tsugumi event emote. Fix some trigger compatibility and update 6 years ago
sigonasr2 8f384d2442 Update Bandori Module. Added in some extra triggers. 6 years ago
sigonasr2 09c42f0155 Hagumi stamp update fix. 6 years ago
sigonasr2 0e9240a8eb Bandori Module update, add Hagumi sticker "Hooray!" 6 years ago
sigonasr2 e3407768cc Remove Happy birthday trigger for Rinko. 6 years ago
sigonasr2 ea99653722 Set default FPS back to 30. 6 years ago
sigonasr2 8205f1028b Add DDR Step Module. Added Birthday for Rinko. 6 years ago
sigonasr2 a0f004d5f2 Fix sub emote downloading being disabled by accident. Added new Sayo 6 years ago
sigonasr2 5a960e50ea Update Arisa trigger. 6 years ago
sigonasr2 9409cd0d60 Update Bandori Module to use built-in Kokoro "What a great idea" stamp 6 years ago
sigonasr2 950287cae7 Add in magic number. 6 years ago
sigonasr2 ed3e02b8e7 Fix stamp reference. 6 years ago
sigonasr2 68792797ba Add in new emote. "What a great idea!" 6 years ago
sigonasr2 a6fa2fa005 Update more Bandori Module stamp triggers. 6 years ago
sigonasr2 e2c29e7827 Updated Sticker Triggers 6 years ago
sigonasr2 09264b32e1 Rebuild sigIRCv2 6 years ago
sigonasr2 b6c851fea7 Add in max character limit. Add in new bandori triggers. 6 years ago
sigonasr2 e6240111a5 Update bandori emote triggers list 6 years ago
sigonasr2 3aaf5889d9 Add in Hina's Event Sticker to bandori triggers. 7 years ago
sigonasr2 485e58efea Update Bandori popup message triggers. 7 years ago
sigonasr2 92184cee24 Updated Bandori Module's chat triggers. Included information about who 7 years ago
sigonasr2 cedfcf0974 Created Bandori Module, which responds to the chat messages and presents 7 years ago
sigonasr2 c035f052d6 Fix Error 299 spam from PsapiTools 7 years ago
sigonasr2 6dd2145ef9 Fixed bug with null String values in Touhou Mother module. 7 years ago
sigonasr2 dd3d9148f3 Fixed strange memory error issues with error checking. 7 years ago
sigonasr2 e691a37246 Fix online retrival of files with spaces. Implement built-in memory 7 years ago
sigonasr2 52e7358b81 Map and Item % values updated for v.1.90 of Rabi-Ribi instead of some 7 years ago
sigonasr2 9b0879476f Updated Map + Item % Memory Values for v.1.90 of Rabi-Ribi. 7 years ago
sigonasr2 844f2b963c Updated Rabi-Race module to v1.90 of Rabi-Ribi memory values. 7 years ago
sigonasr2 86f9c7a7e7 Added Gold Carrot to Key Items list. 7 years ago
sigonasr2 df247b7bf3 Update .classpath with relative file locations. 7 years ago
  1. 23
      .classpath
  2. 9
      .gitignore
  3. 4
      .settings/org.eclipse.core.resources.prefs
  4. 100
      .settings/org.eclipse.jdt.core.prefs
  5. BIN
      Boss Sprites/Cirno.png
  6. BIN
      Boss Sprites/DevilMachine.png
  7. BIN
      Boss Sprites/ENEMYDiamondMasahirorin.png
  8. BIN
      Boss Sprites/Masked_Maid_Girl.png
  9. BIN
      Boss Sprites/Starman_Junior.png
  10. BIN
      Boss Sprites/TME_-100.png
  11. BIN
      Boss Sprites/TME_-10000.png
  12. BIN
      Boss Sprites/TME_-101.png
  13. BIN
      Boss Sprites/TME_-84.png
  14. BIN
      Boss Sprites/TME_103.png
  15. BIN
      Boss Sprites/TME_104.png
  16. BIN
      Boss Sprites/TME_108.png
  17. BIN
      Boss Sprites/TME_120.png
  18. BIN
      Boss Sprites/TME_122.png
  19. BIN
      Boss Sprites/TME_136.png
  20. BIN
      Boss Sprites/TME_137.png
  21. BIN
      Boss Sprites/TME_138.png
  22. BIN
      Boss Sprites/TME_15.png
  23. BIN
      Boss Sprites/TME_200.png
  24. BIN
      Boss Sprites/TME_202.png
  25. BIN
      Boss Sprites/TME_203.png
  26. BIN
      Boss Sprites/TME_23.png
  27. BIN
      Boss Sprites/TME_24.png
  28. BIN
      Boss Sprites/TME_33.png
  29. BIN
      Boss Sprites/TME_38.png
  30. BIN
      Boss Sprites/TME_43.png
  31. BIN
      Boss Sprites/TME_44.png
  32. BIN
      Boss Sprites/TME_48.png
  33. BIN
      Boss Sprites/TME_53.png
  34. BIN
      Boss Sprites/TME_55.png
  35. BIN
      Boss Sprites/TME_63.png
  36. BIN
      Boss Sprites/TME_68.png
  37. BIN
      Boss Sprites/TME_73.png
  38. BIN
      Boss Sprites/TME_74.png
  39. BIN
      Boss Sprites/TME_83.png
  40. BIN
      Boss Sprites/TME_900000.png
  41. BIN
      Boss Sprites/TME_999997.png
  42. BIN
      Boss Sprites/TME_999999.png
  43. BIN
      Boss Sprites/Youmu_Never_Loses.png
  44. BIN
      Unifont.ttf
  45. 76
      sigIRCv2.conf.backup
  46. BIN
      sigIRCv2.jar
  47. 8
      src/sig/FileManager.java
  48. 43
      src/sig/Module.java
  49. 10
      src/sig/ModuleLinker.java
  50. 208
      src/sig/ModuleSelector.java
  51. 50
      src/sig/ModuleSelectorButton.java
  52. 56
      src/sig/MyPanel.java
  53. 4
      src/sig/ScrollingText.java
  54. 7
      src/sig/SubEmoticon.java
  55. 16
      src/sig/UpdateEvent.java
  56. 43
      src/sig/modules/Bandori/SongPart.java
  57. 482
      src/sig/modules/BandoriModule.java
  58. 21
      src/sig/modules/ChatLogModule.java
  59. 213
      src/sig/modules/ControllerModule.java
  60. 303
      src/sig/modules/DDRStepModule.java
  61. 10
      src/sig/modules/MapPoint.java
  62. 81
      src/sig/modules/RabiRace/ColorLocation.java
  63. 3
      src/sig/modules/RabiRace/JoinButton.java
  64. 26
      src/sig/modules/RabiRace/MarkMapButton.java
  65. 1
      src/sig/modules/RabiRace/MemoryData.java
  66. 318
      src/sig/modules/RabiRace/Profile.java
  67. 51
      src/sig/modules/RabiRace/Session.java
  68. 47
      src/sig/modules/RabiRace/SessionCreateWindow.java
  69. 4
      src/sig/modules/RabiRace/SessionListWindow.java
  70. 488
      src/sig/modules/RabiRaceModule.java
  71. 280
      src/sig/modules/RabiRibi/MemoryOffset.java
  72. 21
      src/sig/modules/RabiRibiModule.java
  73. 241
      src/sig/modules/TouhouMotherModule.java
  74. 28
      src/sig/modules/Twitch/Announcement.java
  75. 47
      src/sig/modules/Twitch/Follower.java
  76. 272
      src/sig/modules/TwitchModule.java
  77. 2
      src/sig/modules/utils/PsapiTools.java
  78. 2
      src/sig/modules/utils/SemiValidInteger.java
  79. 255
      src/sig/sigIRC.java
  80. 48
      src/sig/utils/DrawUtils.java
  81. 56
      src/sig/utils/FileUtils.java
  82. 6
      src/sig/utils/TextUtils.java
  83. 1
      tmp

@ -2,18 +2,17 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="lib"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="lib/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-linux.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-macos.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-windows.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-linux.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-macos.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-windows.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-4.5.0.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-platform-4.5.0.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-linux.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-macos.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-windows.jar"/>
<classpathentry kind="lib" path="lib/lwjgl.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-natives-linux.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-natives-macos.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-natives-windows.jar"/>
<classpathentry kind="lib" path="lib/jna-4.5.0.jar"/>
<classpathentry kind="lib" path="lib/jna-platform-4.5.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

9
.gitignore vendored

@ -15,3 +15,12 @@
/jinput-raw_64.dll
/jinput-wintab.dll
/memoryDump.txt
/sessions
/tmp_profile
/debug.log
/follows
/map_icons.png
/mapdata
/temp_connect
/tmp_mapdata
/tmp2

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/sig/modules/RabiRace/SessionCreateWindow.java=UTF-8
encoding//src/sig/modules/RabiRace/SessionListWindow.java=UTF-8
encoding//src/sig/modules/RabiRibi/MemoryOffset.java=UTF-8

@ -1,4 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@ -6,6 +15,97 @@ org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

@ -0,0 +1,76 @@
#
#Properties file for sigIRCv2
#Thu Sep 13 20:34:27 CDT 2018
Auto_Update_Program=1
Automatically_Update_Program=false
BANDORI_module_X=76
BANDORI_module_Y=307
BANDORI_module_height=120
BANDORI_module_width=640
CHATLOG_module_BackgroundColor=195,195,195,255
CHATLOG_module_MessageHistory=50
CHATLOG_module_X=1042
CHATLOG_module_Y=388
CHATLOG_module_height=518
CHATLOG_module_width=516
CONTROLLER_module_X=46
CONTROLLER_module_Y=272
CONTROLLER_module_height=312
CONTROLLER_module_width=320
Disable_Chat_Messages=false
Max_FPS=30
Module_bandori_Enabled=false
Module_chatlog_Enabled=false
Module_controller_Enabled=false
Module_rabirace_Enabled=false
Module_rabiribi_Enabled=false
Module_touhoumother_Enabled=false
Module_twitch_Enabled=false
RABIRACE_module_X=492
RABIRACE_module_Y=226
RABIRACE_module_height=561
RABIRACE_module_width=481
RABIRIBI_module_X=0
RABIRIBI_module_Y=0
RABIRIBI_module_height=1050
RABIRIBI_module_width=1680
SCROLLINGCHAT_module_X=1016
SCROLLINGCHAT_module_Y=223
SCROLLINGCHAT_module_height=132
SCROLLINGCHAT_module_width=456
TOUHOUMOTHER_module_X=0
TOUHOUMOTHER_module_Y=312
TOUHOUMOTHER_module_height=312
TOUHOUMOTHER_module_width=320
TWITCH_module_X=507
TWITCH_module_Y=366
TWITCH_module_followerText_Y=42
TWITCH_module_followerText_centerX=292
TWITCH_module_follower_img=sigIRC/glaceon_follower.png
TWITCH_module_follower_img_animation=true
TWITCH_module_height=200
TWITCH_module_newFollowerImgBackgroundColor=90,90,90
TWITCH_module_newFollowerImgLogoSize=32
TWITCH_module_newFollowerShadowTextColor=26,90,150
TWITCH_module_newFollowerTextColor=255,255,255
TWITCH_module_width=500
Testing_Mode=false
backgroundColor=-10066177
channel=\#SigoNitori
chatRows=3
chatScrollSpd=4
dingThreshold=6
hardware_acceleration=true
lastSubEmote_APIUpdate=331
messageFont=Gill Sans Ultra Bold Condensed
nickname=SigoNitori
overlayMode=false
rowSpacing=64
server=irc.chat.twitch.tv
showWindowControls=true
touhoumotherConsoleFont=Agency FB Bold
usernameFont=Segoe UI Semibold
windowHeight=632
windowWidth=1212
windowX=442
windowY=205

Binary file not shown.

@ -9,18 +9,18 @@ import sig.utils.DebugUtils;
public class FileManager {
String fileloc;
final String serverURL = "http://45.33.13.215/sigIRCv2/";
final String serverURL = "http://45.33.13.215:8080/sigIRCv2/";
boolean folder=false;
public FileManager(String location) {
this.fileloc=location;
if (fileloc.contains(" ")) {
/*if (fileloc.contains(" ")) {
System.out.println("!!!!!!!!!!!!!!!!!!");
System.out.println("!!!!!WARNING!!!!!!");
System.out.println("There is a space in the global file location "+fileloc+". This is going to cause huge errors!");
System.out.println("!!!!!!!!!!!!!!!!!!");
DebugUtils.showStackTrace();
}
}*/
this.folder=false;
}
@ -46,7 +46,7 @@ public class FileManager {
if (!file.exists()) {
System.out.println("Could not find "+file.getAbsolutePath()+", retrieving file online from "+serverURL+file.getName()+".");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL(serverURL+fileloc),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL(serverURL.replaceAll(" ", "%20")+fileloc.replaceAll(" ", "%20")),file);
if (file.exists()) {
System.out.println(" >> Successfully downloaded "+file.getAbsolutePath()+".");
}

@ -53,7 +53,7 @@ public class Module {
}
private void enableWindowDrag(int mouseX, int mouseY) {
if (!sigIRC.overlayMode && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) {
if (sigIRC.showWindowControls && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) {
//Enable dragging.
dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY);
dragging=DRAGGING=true;
@ -103,22 +103,31 @@ public class Module {
}
}
public static void loadModule() {
}
public static void unloadModule() {
}
private void dragWindow() {
if (dragging) {
//sigIRC.panel.repaint(getDrawBounds().getBounds());
int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX();
int mouseY = sigIRC.panel.lastMouseY+(int)dragOffset.getY();
int oldX = (int)position.getX();
int oldY = (int)position.getY();
position = new Rectangle((int)Math.min(Math.max(0,mouseX),sigIRC.window.getWidth()-position.getWidth()), (int)Math.min(Math.max(titleHeight,mouseY),sigIRC.window.getHeight()-position.getHeight()-titleHeight*2),(int)position.getWidth(),(int)position.getHeight());
//System.out.println(sigIRC.panel.lastMouseX+","+sigIRC.panel.lastMouseY);
ModuleDragEvent(oldX,oldY,mouseX,mouseY);
}
if (inDragBounds(sigIRC.panel.lastMouseX,sigIRC.panel.lastMouseY)) {
inDragZone=true;
//System.out.println("In Drag Zone for Module "+name);
//sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
} /*else
if (sigIRC.showWindowControls) {
if (dragging) {
//sigIRC.panel.repaint(getDrawBounds().getBounds());
int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX();
int mouseY = sigIRC.panel.lastMouseY+(int)dragOffset.getY();
int oldX = (int)position.getX();
int oldY = (int)position.getY();
position = new Rectangle((int)Math.min(Math.max(0,mouseX),sigIRC.window.getWidth()-position.getWidth()), (int)Math.min(Math.max(titleHeight,mouseY),sigIRC.window.getHeight()-position.getHeight()-titleHeight*2),(int)position.getWidth(),(int)position.getHeight());
//System.out.println(sigIRC.panel.lastMouseX+","+sigIRC.panel.lastMouseY);
ModuleDragEvent(oldX,oldY,mouseX,mouseY);
}
if (inDragBounds(sigIRC.panel.lastMouseX,sigIRC.panel.lastMouseY)) {
inDragZone=true;
//System.out.println("In Drag Zone for Module "+name);
//sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
}
}/*else
if (sigIRC.panel.getCursor().getType()==Cursor.MOVE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}*/
@ -141,7 +150,7 @@ public class Module {
}
private void drawModuleHeader(Graphics g) {
if (!sigIRC.overlayMode) {
if (sigIRC.showWindowControls) {
g.drawImage(Module.IMG_DRAGBAR,
(int)position.getX()+2,
(int)position.getY()-Module.IMG_DRAGBAR.getHeight(),

@ -0,0 +1,10 @@
package sig;
public class ModuleLinker {
public String name = "";
public Module mod;
public ModuleLinker(String name,Module mod) {
this.name = name;
this.mod = mod;
}
}

@ -0,0 +1,208 @@
package sig;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import sig.modules.BandoriModule;
import sig.modules.ChatLogModule;
import sig.modules.ControllerModule;
import sig.modules.DDRStepModule;
import sig.modules.RabiRaceModule;
import sig.modules.RabiRibiModule;
import sig.modules.TouhouMotherModule;
import sig.modules.TwitchModule;
public class ModuleSelector extends JFrame implements WindowListener{
public static JCheckBox bandoriBox = new JCheckBox("Bandori",sigIRC.bandorimodule_enabled);
public static JCheckBox ddrstepBox = new JCheckBox("DDR Step",sigIRC.ddrstepmodule_enabled);
public static JCheckBox rabiraceBox = new JCheckBox("Rabi Race",sigIRC.rabiracemodule_enabled);
public static JCheckBox rabiribiBox = new JCheckBox("Rabi Ribi (Broken)",sigIRC.rabiribimodule_enabled);
public static JCheckBox controllerBox = new JCheckBox("Controller",sigIRC.controllermodule_enabled);
public static JCheckBox chatlogBox = new JCheckBox("Chat Log",sigIRC.chatlogmodule_enabled);
public static JCheckBox twitchBox = new JCheckBox("Twitch",sigIRC.twitchmodule_enabled);
public static JCheckBox touhoumotherBox = new JCheckBox("Touhou Mother",sigIRC.touhoumothermodule_enabled);
public ModuleSelector() {
JPanel panel = new JPanel();
bandoriBox.setActionCommand("bandori");
bandoriBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("bandori")) {
if (ModuleSelector.bandoriBox.isSelected()) {
BandoriModule.loadModule();
} else {
BandoriModule.unloadModule();
}
}
}
});
bandoriBox.setVisible(true);
ddrstepBox.setActionCommand("ddrstep");
ddrstepBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("ddrstep")) {
if (ModuleSelector.ddrstepBox.isSelected()) {
DDRStepModule.loadModule();
} else {
DDRStepModule.unloadModule();
}
}
}
});
ddrstepBox.setVisible(true);
rabiraceBox.setActionCommand("rabirace");
rabiraceBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("rabirace")) {
if (ModuleSelector.rabiraceBox.isSelected()) {
RabiRaceModule.loadModule();
} else {
RabiRaceModule.unloadModule();
}
}
}
});
rabiraceBox.setVisible(true);
rabiribiBox.setActionCommand("rabiribi");
rabiribiBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("rabiribi")) {
if (ModuleSelector.rabiribiBox.isSelected()) {
RabiRibiModule.loadModule();
} else {
RabiRibiModule.unloadModule();
}
}
}
});
rabiribiBox.setVisible(true);
controllerBox.setActionCommand("controller");
controllerBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("controller")) {
if (ModuleSelector.controllerBox.isSelected()) {
ControllerModule.loadModule();
} else {
ControllerModule.unloadModule();
}
}
}
});
controllerBox.setVisible(true);
chatlogBox.setActionCommand("chatlog");
chatlogBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("chatlog")) {
if (ModuleSelector.chatlogBox.isSelected()) {
ChatLogModule.loadModule();
} else {
ChatLogModule.unloadModule();
}
}
}
});
chatlogBox.setVisible(true);
twitchBox.setActionCommand("twitch");
twitchBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("twitch")) {
if (ModuleSelector.twitchBox.isSelected()) {
TwitchModule.loadModule();
} else {
TwitchModule.unloadModule();
}
}
}
});
twitchBox.setVisible(true);
touhoumotherBox.setActionCommand("touhoumother");
touhoumotherBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (ev.getActionCommand().equalsIgnoreCase("touhoumother")) {
if (ModuleSelector.touhoumotherBox.isSelected()) {
TouhouMotherModule.loadModule();
} else {
TouhouMotherModule.unloadModule();
}
}
}
});
touhoumotherBox.setVisible(true);
panel.setVisible(true);
panel.add(twitchBox);
panel.add(chatlogBox);
panel.add(controllerBox);
panel.add(rabiraceBox);
panel.add(bandoriBox);
panel.add(touhoumotherBox);
panel.add(ddrstepBox);
panel.add(rabiribiBox);
panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS));
this.add(panel);
this.pack();
//this.setVisible(true);
this.repaint();
}
@Override
public void windowOpened(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosing(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosed(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowIconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowDeiconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowActivated(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowDeactivated(WindowEvent e) {
// TODO Auto-generated method stub
}
}

@ -0,0 +1,50 @@
package sig;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.imageio.ImageIO;
import sig.sigIRC;
import sig.modules.TouhouMotherModule;
import sig.utils.DrawUtils;
import sig.utils.FileUtils;
import sig.utils.TextUtils;
public class ModuleSelectorButton {
BufferedImage buttonimg;
int x=0;
int y=0;
boolean buttonEnabled = true;
public ModuleSelectorButton(File filename, int x, int y) {
this.x=x;
this.y=y;
try {
buttonimg = ImageIO.read(filename);
} catch (IOException e) {
e.printStackTrace();
}
}
public void draw(Graphics g) {
if (buttonEnabled) {
g.drawImage(buttonimg, x, y, sigIRC.panel);
}
}
public void onClickEvent(MouseEvent ev) {
if (buttonEnabled && !sigIRC.overlayMode) {
if (ev.getX()>=x && ev.getX()<=x+buttonimg.getWidth() &&
ev.getY()>=y && ev.getY()<=y+buttonimg.getHeight()) {
sigIRC.moduleSelectorWindow.setVisible(true);
}
}
}
}

@ -4,6 +4,7 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.Graphics;
import java.awt.GraphicsEnvironment;
import java.awt.MouseInfo;
@ -24,27 +25,44 @@ import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;
import javax.swing.JColorChooser;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import sig.modules.BandoriModule;
import sig.modules.ChatLogModule;
import sig.modules.ChatLog.ChatLogMessage;
import sig.utils.DrawUtils;
import sig.utils.FileUtils;
import sig.utils.TextUtils;
public class MyPanel extends JPanel implements MouseListener, ActionListener, MouseWheelListener, KeyListener, ComponentListener, WindowListener{
//List<String> messages = new ArrayList<String>();
final public static Font programFont = new Font(sigIRC.messageFont,0,24);
final public static Font userFont = new Font(sigIRC.usernameFont,0,16);
final public static Font smallFont = new Font(sigIRC.touhoumotherConsoleFont,0,12);
public static Font programFont = new Font(sigIRC.messageFont,Font.BOLD,32);
public static Font userFont = new Font(sigIRC.usernameFont,Font.BOLD,16);
public static Font smallFont = new Font(sigIRC.touhoumotherConsoleFont,0,12);
final public static Font rabiRibiMoneyDisplayFont = new Font("CP Font",0,16);
final public static Font rabiRibiTinyDisplayFont = new Font("CP Font",0,12);
public int lastMouseX = 0;
public int lastMouseY = 0;
public MyPanel() {
programFont = programFont.deriveFont(sigIRC.messageFontSize);
userFont = userFont.deriveFont(sigIRC.usernameFontSize);
smallFont = smallFont.deriveFont(sigIRC.touhoumotherConsoleFontSize);
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(sigIRC.BASEDIR+"sigIRC/CP_Font.ttf")));
} catch (FontFormatException | IOException e) {
e.printStackTrace();
}
//setBorder(BorderFactory.createLineBorder(Color.black));
addMouseListener(this);
addMouseWheelListener(this);
@ -61,10 +79,14 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
super.paintComponent(g);
// Draw Text
//int counter=18;
if (sigIRC.panel!=null) {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
//System.out.println("("+lastMouseX+","+lastMouseY+")");
try {
if (sigIRC.panel!=null && MouseInfo.getPointerInfo()!=null) {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
//System.out.println("("+lastMouseX+","+lastMouseY+")");
}
} catch (NullPointerException e) {
//Do Nothing I guess.
}
/*if (sigIRC.window!=null && sigIRC.window.getMousePosition(true)!=null && sigIRC.overlayMode) {
lastMouseX = (int)sigIRC.window.getMousePosition(true).getX();
@ -75,6 +97,12 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
lastMouseY = -1;
}*/
//
//AudioSystem.getMixerInfo()[0].
/*for (Mixer.Info i : AudioSystem.getMixerInfo()) {
System.out.println(i+": "+AudioSystem.getMixer(i).isOpen());
}*/
//System.out.println(Audio.getMasterOutputVolume());
for (Module m : sigIRC.modules) {
m.draw(g);
}
@ -83,6 +111,11 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
sigIRC.chatlogtwitchemoticons.get(i).draw(g);
}
}
if (sigIRC.newUpdateIsAvailable) {
DrawUtils.drawOutlineText(g, MyPanel.programFont, sigIRC.panel.getWidth()
- TextUtils.calculateStringBoundsFont("NEW UPDATE AVAILABLE!!",MyPanel.programFont).getWidth(), sigIRC.panel.getHeight()
- TextUtils.calculateStringBoundsFont("NEW UPDATE AVAILABLE!!",MyPanel.programFont).getHeight(), 2, Color.RED, Color.WHITE, "NEW UPDATE AVAILABLE!!");
}
for (int i=0;i<sigIRC.textobj.size();i++) {
if (sigIRC.textobj.get(i).isActive()) {
if (sigIRC.overlayMode) {
@ -108,6 +141,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
}
if (!sigIRC.overlayMode) {
sigIRC.button.draw(g);
sigIRC.modulebutton.draw(g);
}
}
@ -120,6 +154,9 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
TextRow row = TextRow.PickRandomTextRow(text.getUsername());
sigIRC.textobj.add(text);
row.updateRow(text);
if (sigIRC.bandorimodule_enabled) {
BandoriModule.checkForStamp(text.getUsername(), text.getMessage());
}
//ChatLogMessage.importMessages(message);
}
@ -133,6 +170,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
m.mouseModuleMousePress(ev);
}
sigIRC.button.onClickEvent(ev);
sigIRC.modulebutton.onClickEvent(ev);
}
@Override
@ -198,8 +236,10 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
sigIRC.config.setInteger("windowY", sigIRC.windowY);
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight);
sigIRC.button.x = sigIRC.panel.getX()+sigIRC.panel.getWidth()-96;
sigIRC.button.x = sigIRC.panel.getX()+sigIRC.panel.getWidth()-192;
sigIRC.button.y = 64+sigIRC.rowobj.size()*sigIRC.rowSpacing;
sigIRC.modulebutton.x = sigIRC.panel.getX()+sigIRC.panel.getWidth()-96;
sigIRC.modulebutton.y = 64+sigIRC.rowobj.size()*sigIRC.rowSpacing;
//com.repaint();
//sigIRC.panel.repaint();
sigIRC.config.saveProperties();

@ -175,7 +175,7 @@ public class ScrollingText {
if (isAlive && WithinBounds(x,y,Math.max(TextUtils.calculateStringBoundsFont(username, MyPanel.userFont).getWidth(), TextUtils.calculateStringBoundsFont(message, MyPanel.programFont).getWidth()),Math.max(TextUtils.calculateStringBoundsFont(username, MyPanel.userFont).getHeight(), TextUtils.calculateStringBoundsFont(message, MyPanel.programFont).getHeight()))) {
//DrawUtils.drawTextFont(g, MyPanel.userFont, x+8, y+stringHeight-20, Color.GREEN, username);
DrawUtils.drawOutlineText(g, MyPanel.userFont, x+8, y+stringHeight-20, 2, userColor, Color.BLACK, username);
DrawUtils.drawOutlineText(g, MyPanel.programFont, x, y+stringHeight, 2, Color.WHITE, Color.BLACK, message);
DrawUtils.drawOutlineText(g, MyPanel.programFont, x, y+stringHeight+5, 1, 3, Color.WHITE, Color.BLACK, message);
}
}
@ -284,7 +284,7 @@ public class ScrollingText {
String cutstring = basemsg.substring(0, pos);
double width = TextUtils.calculateStringBoundsFont(cutstring, sigIRC.panel.programFont).getWidth();
//System.out.println("Width of '"+cutstring+"' is "+width);
sigIRC.createEmoticon(e, this, (int)(width), 0);
sigIRC.createEmoticon(e, this, (int)(width), 8);
textMaxHeight = Math.max(textMaxHeight, e.getImage().getHeight());
//textMaxWidth = (int)(width + e.getImage().getWidth()+1);
}

@ -2,13 +2,6 @@ package sig;
import java.net.URL;
import com.mb3364.twitch.api.handlers.ChannelResponseHandler;
import com.mb3364.twitch.api.handlers.ChannelSubscriptionResponseHandler;
import com.mb3364.twitch.api.handlers.UserSubscriptionResponseHandler;
import com.mb3364.twitch.api.models.Channel;
import com.mb3364.twitch.api.models.ChannelSubscription;
import com.mb3364.twitch.api.models.UserSubscription;
public class SubEmoticon extends Emoticon{
String channelName = "";
static boolean userCanUseEmoticon=false;

@ -32,13 +32,14 @@ public class UpdateEvent implements ActionListener{
}
private void UpdateSubEmoticons() {
//System.out.println("Subchannels: "+sigIRC.subchannelCount+", "+sigIRC.subchannelIds.size());
if (!sigIRC.downloadedSubEmotes &&
sigIRC.disableChatMessages &&
!sigIRC.disableChatMessages &&
sigIRC.subchannelCount==sigIRC.subchannelIds.size()) {
Thread downloadThread = new Thread(){
public void run() {
JSONObject data = GetSubEmoteJson();
sigIRC.downloadSubEmotes(data);
//JSONObject data = GetSubEmoteJson();
sigIRC.downloadSubEmotes();
sigIRC.subEmotesCompleted=true;
}
};
@ -47,8 +48,8 @@ public class UpdateEvent implements ActionListener{
}
}
private JSONObject GetSubEmoteJson() {
JSONObject subemotes = null;
private boolean GetSubEmotesNeedChecking() {
/*JSONObject subemotes = null;
try {
File filer = new File(sigIRC.SUBEMOTELISTFILE);
if (!filer.exists()) {
@ -76,10 +77,11 @@ public class UpdateEvent implements ActionListener{
}
} catch (JSONException | IOException e) {
e.printStackTrace();
}
}*/
boolean needsUpdate = sigIRC.lastSubEmoteUpdate != Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
sigIRC.lastSubEmoteUpdate = Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
sigIRC.config.setInteger("lastSubEmote_APIUpdate", sigIRC.lastSubEmoteUpdate);
return subemotes;
return needsUpdate;
}
private void UpdateWindowPosition() {

@ -0,0 +1,43 @@
package sig.modules.Bandori;
import java.util.Random;
public class SongPart {
String name;
int trials;
int successes;
public SongPart(String partname) {
this.name = partname;
this.trials = this.successes = 0;
}
public void setTitle(String title) {
this.name = title;
}
public void setSuccesses(Integer successes) {
this.successes = successes;
}
public void setTrials(Integer trials) {
this.trials = trials;
}
public String getTitle() {
return this.name;
}
public Integer getSuccesses() {
return this.successes;
}
public Integer getTotal() {
return this.trials;
}
public void AddtoTrials(boolean success) {
if (success) {
this.successes++;
}
this.trials++;
}
}

@ -0,0 +1,482 @@
package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;
import javafx.geometry.Point2D;
import sig.FileManager;
import sig.Module;
import sig.sigIRC;
import sig.modules.Bandori.SongPart;
import sig.utils.DrawUtils;
import sig.utils.SoundUtils;
public class BandoriModule extends Module{
public static BandoriModule bandori_module;
public BufferedImage stamp_collection1,stamp_collection2,stamp_collection3
,stamp_collection4,stamp_collection5,stamp_collection6,stamp_collection7,stamp_collection8,stamp_collection9,stamp_collection10,stamp_collection11;
public static HashMap<String,ImageScheme> image_map = new HashMap<String,ImageScheme>();
public static HashMap<String,List<String>> stamp_map = new HashMap<String,List<String>>();
static List<Stamp> active_stamps = new ArrayList<Stamp>();
String songtitle = "";
List<SongPart> parts = new ArrayList<SongPart>();
boolean holdControl = false, holdAlt = false;
JOptionPane pane = new JOptionPane();
public BandoriModule(Rectangle2D bounds, String moduleName) {
this(bounds,moduleName,true);
}
public BandoriModule(Rectangle2D bounds, String moduleName, boolean enabled) {
super(bounds, moduleName, enabled);
Initialize();
}
void Initialize() {
BandoriModule.bandori_module = this;
try {
stamp_collection1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps1.png"));
stamp_collection2 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps2_2.png"));
stamp_collection3 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_018003.png"));
stamp_collection4 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_003003.png"));
stamp_collection5 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_007003.png"));
stamp_collection6 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_011005.png"));
stamp_collection7 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_013003.png"));
stamp_collection8 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_016002.png"));
stamp_collection9 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_017004.png"));
stamp_collection10 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_021004.png"));
stamp_collection11 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_006004.png"));
} catch (IOException e) {
e.printStackTrace();
}
image_map.put("kasumi_gogo", new ImageScheme(stamp_collection1,0));
image_map.put("tae_letsplay", new ImageScheme(stamp_collection1,1));
image_map.put("rimi_choco", new ImageScheme(stamp_collection1,2));
image_map.put("saya_bread", new ImageScheme(stamp_collection1,3));
image_map.put("arisa_doki", new ImageScheme(stamp_collection1,4));
image_map.put("ran_same", new ImageScheme(stamp_collection1,5));
image_map.put("moca_youdidit", new ImageScheme(stamp_collection1,6));
image_map.put("himari_heyheyhoh", new ImageScheme(stamp_collection1,7));
image_map.put("tomoe_letsdothis", new ImageScheme(stamp_collection1,8));
image_map.put("tsugumi_wecandoit", new ImageScheme(stamp_collection1,9));
image_map.put("kokoro_happylucky", new ImageScheme(stamp_collection1,10));
image_map.put("kaoru_fleeting", new ImageScheme(stamp_collection1,11));
image_map.put("hagumi_smileyay", new ImageScheme(stamp_collection1,12));
image_map.put("kanon_fuee", new ImageScheme(stamp_collection1,13));
image_map.put("misaki_ready", new ImageScheme(stamp_collection1,14));
image_map.put("aya_fever", new ImageScheme(stamp_collection1,15));
image_map.put("hina_fullcombo", new ImageScheme(stamp_collection1,16));
image_map.put("chisato_planned", new ImageScheme(stamp_collection1,17));
image_map.put("maya_huhehe", new ImageScheme(stamp_collection1,18));
image_map.put("eve_bushido", new ImageScheme(stamp_collection1,19));
image_map.put("yukina_notbad", new ImageScheme(stamp_collection1,20));
image_map.put("sayo_goodwork", new ImageScheme(stamp_collection1,21));
image_map.put("lisa_nextonelastone", new ImageScheme(stamp_collection1,22));
image_map.put("ako_onemoretime", new ImageScheme(stamp_collection1,23));
image_map.put("rinko_jam", new ImageScheme(stamp_collection2,0));
image_map.put("marina_yeahyeah", new ImageScheme(stamp_collection2,1)); //Skip 2.
image_map.put("cookie_cookie", new ImageScheme(stamp_collection2,2)); //Skip 2.
image_map.put("kokoro_moremore", new ImageScheme(stamp_collection2,3));
image_map.put("arisa_huh", new ImageScheme(stamp_collection2,4));
image_map.put("yukina_followmylead", new ImageScheme(stamp_collection2,5));
image_map.put("kaoru_suchalovelyevening", new ImageScheme(stamp_collection2,6));
image_map.put("rimi_congrats", new ImageScheme(stamp_collection2,7));
image_map.put("ran_somethingbigiscoming", new ImageScheme(stamp_collection2,8));
image_map.put("tsugumi_comeon", new ImageScheme(stamp_collection2,9));
image_map.put("tae_fufusocute", new ImageScheme(stamp_collection2,10));
image_map.put("eve_marchintobattle", new ImageScheme(stamp_collection2,11));
image_map.put("saya_illtry", new ImageScheme(stamp_collection2,12));
image_map.put("lisa_imsohappy", new ImageScheme(stamp_collection2,13));
image_map.put("sayo_ohwell", new ImageScheme(stamp_collection2,14));
image_map.put("ako_areyouokay", new ImageScheme(stamp_collection2,15));
image_map.put("chisato_thisissomuchfun", new ImageScheme(stamp_collection2,16));
image_map.put("rinko_theresnoway", new ImageScheme(stamp_collection2,17));
image_map.put("tae_thisisgreat", new ImageScheme(stamp_collection2,18));
image_map.put("moca_thisisgettinginteresting", new ImageScheme(stamp_collection2,19));
image_map.put("kaoru_takemyhand", new ImageScheme(stamp_collection2,20));
image_map.put("kokoro_letsmaketheworldsmile", new ImageScheme(stamp_collection2,21));
image_map.put("hina_nowwereboppin", new ImageScheme(stamp_collection2,22));
image_map.put("kokoro_what_a_great_idea", new ImageScheme(stamp_collection2,23));
image_map.put("sayo_im_sorry", new ImageScheme(stamp_collection2,24));
image_map.put("hagumi_hooray", new ImageScheme(stamp_collection2,25));
image_map.put("tsugumi_amazing", new ImageScheme(stamp_collection2,26));
image_map.put("eve_thefruits", new ImageScheme(stamp_collection2,27));
image_map.put("lisa_imnotready", new ImageScheme(stamp_collection2,28));
image_map.put("arisa_okayhereigo", new ImageScheme(stamp_collection2,29));
image_map.put("tomoe_giveityourall", new ImageScheme(stamp_collection2,30));
image_map.put("kanon_keepgoing", new ImageScheme(stamp_collection2,31));
image_map.put("kokoro_letshavefun", new ImageScheme(stamp_collection2,32));
image_map.put("kasumi_letshaveagreatshow", new ImageScheme(stamp_collection2,33));
image_map.put("ako_illshowyousomethingcool", new ImageScheme(stamp_collection2,34));
image_map.put("yukina_mindifipetyou", new ImageScheme(stamp_collection2,35));
image_map.put("maya_whoa", new ImageScheme(stamp_collection2,36));
image_map.put("hina_interesting", new ImageScheme(stamp_collection2,37));
image_map.put("kaoru_imherewithyou", new ImageScheme(stamp_collection2,38));
image_map.put("ran_itonlygetsbetter", new ImageScheme(stamp_collection2,39));
image_map.put("himari_onthescene", new ImageScheme(stamp_collection2,40));
image_map.put("rinko_wasthatgood", new ImageScheme(stamp_collection2,41));
image_map.put("chisato_greaterthangreat", new SingleImageScheme(stamp_collection3));
image_map.put("rimi_imsureitllbefine", new SingleImageScheme(stamp_collection4));
image_map.put("moca_letsgetstarted", new SingleImageScheme(stamp_collection5));
image_map.put("kokoro_justlikethat", new SingleImageScheme(stamp_collection6));
image_map.put("hagumi_roar", new SingleImageScheme(stamp_collection7));
image_map.put("aya_somuchpressure", new SingleImageScheme(stamp_collection8));
image_map.put("hina_ivebeenwaiting", new SingleImageScheme(stamp_collection9));
image_map.put("yukina_nexttime", new SingleImageScheme(stamp_collection10));
image_map.put("ran_showtime", new SingleImageScheme(stamp_collection11));
stamp_map.put("kasumi_gogo",Arrays.asList("gogo"));
stamp_map.put("cookie_cookie",Arrays.asList("0.o","o.0",":3","fat","michellecookie"));
stamp_map.put("tae_letsplay",Arrays.asList("playtogether","wanttoplay","multilive","letsplay"));
stamp_map.put("rimi_choco",Arrays.asList("choco","cornet"));
stamp_map.put("saya_bread",Arrays.asList("bread"));
stamp_map.put("arisa_doki",Arrays.asList("doki","chomama","baka"));
stamp_map.put("ran_same",Arrays.asList("sameasalways","alwayssame","alwaysthesame","itsum"));
stamp_map.put("moca_youdidit",Arrays.asList("youdidit","congratulations","buns","mocatastic"));
stamp_map.put("himari_heyheyhoh",Arrays.asList("heyo","heyhey","hihi","hiyo","aao"));
stamp_map.put("tomoe_letsdothis",Arrays.asList("letsdothis","letsdoit"));
stamp_map.put("tsugumi_wecandoit",Arrays.asList("wegotthis","wegotit","wecan"));
stamp_map.put("kokoro_happylucky",Arrays.asList("happy!","lucky"));
stamp_map.put("kaoru_fleeting",Arrays.asList("fleeting"));
stamp_map.put("aya_fever",Arrays.asList("fever","ayay"));
stamp_map.put("hagumi_smileyay",Arrays.asList("smileyay","yay!"));
stamp_map.put("kanon_fuee",Arrays.asList("fuu","fue","waa","reee"));
stamp_map.put("misaki_ready",Arrays.asList("ready"));
stamp_map.put("hina_fullcombo",Arrays.asList("fc","fcd","fullcombo","nomiss","allperfect","notasinglemiss","thefc","anfc","fullperfect","easyfc","ezfc"));
stamp_map.put("chisato_planned",Arrays.asList("justasplanned","allplanned","calculated","thatcoming"));
stamp_map.put("maya_huhehe",Arrays.asList("hehe","huehe","huehue","shuwashuwa"));
stamp_map.put("eve_bushido",Arrays.asList("bushido"));
stamp_map.put("yukina_notbad",Arrays.asList("notbad","veryclose"));
stamp_map.put("sayo_goodwork",Arrays.asList("goodwork","goodjob","nicejob","welldone","greatwork","greatjob"));
stamp_map.put("lisa_nextonelastone",Arrays.asList("lastone","mylast"));
stamp_map.put("ako_onemoretime",Arrays.asList("onemore","goagain","keepplaying","dontstop","runit"));
stamp_map.put("rinko_jam",Arrays.asList("lovethissong","jam"/*,"happybirthday"*/));
stamp_map.put("marina_yeahyeah",Arrays.asList("yeahyeah","letsgo"));
stamp_map.put("kokoro_moremore",Arrays.asList("moremore","iwantmore"));
stamp_map.put("arisa_huh",Arrays.asList("huh?","hh?","yy?","aat?","aa?","tt?","nani","nand"));
stamp_map.put("yukina_followmylead",Arrays.asList("followmylead","takethelead","guideyou","fullydevoted"));
stamp_map.put("kaoru_suchalovelyevening",Arrays.asList("goodevening","lovelyevening","beautifulnight","grandnight","wonderfulevening"));
stamp_map.put("rimi_congrats",Arrays.asList("grats"));
stamp_map.put("ran_somethingbigiscoming",Arrays.asList("somethingbig","iscoming","thatishowiroll","truecolor"));
stamp_map.put("tsugumi_comeon",Arrays.asList("comeon","dontbeafraid","dontbeshy"));
stamp_map.put("tae_fufusocute",Arrays.asList("socute","kawaii","fufu","adorable","cute"));
stamp_map.put("eve_marchintobattle",Arrays.asList("marchintobattle","chargeintobattle"));
stamp_map.put("saya_illtry",Arrays.asList("illtry","itachance","itatry","atleastonce"));
stamp_map.put("lisa_imsohappy",Arrays.asList("ecstatic","sohappy","toohappy"));
stamp_map.put("sayo_ohwell",Arrays.asList("ohwell","ahwell","youtried"));
stamp_map.put("ako_areyouokay",Arrays.asList("youok","beok","daijo"));
stamp_map.put("chisato_thisissomuchfun",Arrays.asList("muchfun","veryfun","reallyfun","extremelyfun","offun"));
stamp_map.put("rinko_theresnoway",Arrays.asList("noway"));
stamp_map.put("tae_thisisgreat",Arrays.asList("thisisgreat","thisisawesome","thisiswonderful"));
stamp_map.put("moca_thisisgettinginteresting",Arrays.asList("gettinginteresting","thingsaregetting","thisisgetting"));
stamp_map.put("kaoru_takemyhand",Arrays.asList("takemyhand","allowmeto","demonstrate","romeo"));
stamp_map.put("kokoro_letsmaketheworldsmile",Arrays.asList("hhw","happyworld","hellohappy","worldsmile"));
stamp_map.put("hina_nowwereboppin",Arrays.asList("bop","nowwere","zap"));
stamp_map.put("kokoro_what_a_great_idea",Arrays.asList("greatidea","goodidea","greatthinking","goodthinking"));
stamp_map.put("sayo_im_sorry",Arrays.asList("sorry","gomen","apologize","somethingwrong","forgive"));
stamp_map.put("hagumi_hooray",Arrays.asList("hooray","hiphip","whoo","yahoo"));
stamp_map.put("tsugumi_amazing",Arrays.asList("amazing","wow","sugoi","wooo","cool!","tsugurific"));
stamp_map.put("eve_thefruits",Arrays.asList("fruits","labor","hardwork","effort"));
stamp_map.put("lisa_imnotready",Arrays.asList("notready","notprep","stopit","holdon","onemin","onemom","noread","wontberead","notrdy","nottime","notime","waitam","waitforme"));
stamp_map.put("arisa_okayhereigo",Arrays.asList("hereigo","okayilltry","alrightilltry","domybest","trymybest","alrighty","itashot","myturn","domybest"));
stamp_map.put("tomoe_giveityourall",Arrays.asList("giveiteverything","allyougot","everythingyougot","tryyourbest","giveityourall","youreverything","yourall"));
stamp_map.put("kanon_keepgoing",Arrays.asList("keepgoing","dontstop","youcandoit","makeit","gaja","petan","pettan","pengu"));
stamp_map.put("kokoro_letshavefun",Arrays.asList("havefun","timeforfun"));
stamp_map.put("kasumi_letshaveagreatshow",Arrays.asList("greatshow"));
stamp_map.put("ako_illshowyousomethingcool",Arrays.asList("cool","havefun","timeforfun"));
stamp_map.put("yukina_mindifipetyou",Arrays.asList("petyou"));
stamp_map.put("maya_whoa",Arrays.asList("waaa","whoa")); //It's Showtime~!
stamp_map.put("hina_interesting",Arrays.asList("rururu","interesting","ding"));
stamp_map.put("kaoru_imherewithyou",Arrays.asList("herewithyou","hereforyou"));
stamp_map.put("ran_itonlygetsbetter",Arrays.asList("getsbetter","onlygets"));
stamp_map.put("rinko_wasthatgood",Arrays.asList("wasthatgood","wasitgood"));
stamp_map.put("himari_onthescene",Arrays.asList("thescene"));
stamp_map.put("chisato_greaterthangreat",Arrays.asList("greater"));
stamp_map.put("rimi_imsureitllbefine",Arrays.asList("isfine","itwillbefine","itllbefine","itsfine","thatsokay","bealright"));
stamp_map.put("moca_letsgetstarted",Arrays.asList("started"));
stamp_map.put("kokoro_justlikethat",Arrays.asList("likethat"));
stamp_map.put("hagumi_roar",Arrays.asList("roar","rawr","meow"));
stamp_map.put("aya_somuchpressure",Arrays.asList("pressure","tough","thisalright","itsalright"));
stamp_map.put("hina_ivebeenwaiting",Arrays.asList("waiting"));
stamp_map.put("yukina_nexttime",Arrays.asList("nexttime"));
stamp_map.put("ran_showtime",Arrays.asList("showtime"));
/*for (String s : image_map.keySet()) {
ImageScheme scheme = image_map.get(s);
try {
BufferedImage img = crop(scheme.base,scheme.stamp_index%6*270+4, scheme.stamp_index/6*223+3, 258, 214);
ImageIO.write(img, "png", new File(sigIRC.BASEDIR + "sigIRC/stamps/"+s+".png"));
} catch (IOException e) {
e.printStackTrace();
}
}*/
for (int i=0;i<4;i++) {
parts.add(new SongPart("Song Part "+i));
}
}
public static void loadModule() {
sigIRC.modules.add(new BandoriModule(
new Rectangle(sigIRC.bandorimodule_X,sigIRC.bandorimodule_Y,sigIRC.bandorimodule_width,sigIRC.bandorimodule_height),
"Bandori"
));
sigIRC.bandorimodule_enabled=true;
sigIRC.config.setBoolean("Module_bandori_Enabled", sigIRC.bandorimodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof BandoriModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.bandorimodule_enabled=false;
sigIRC.config.setBoolean("Module_bandori_Enabled", sigIRC.bandorimodule_enabled);
sigIRC.config.saveProperties();
}
public BufferedImage crop(BufferedImage img, int x, int y, int targetWidth, int targetHeight) throws IOException {
int height = img.getHeight();
int width = img.getWidth();
// Coordinates of the image's middle
int xc = (width - targetWidth) / 2;
int yc = (height - targetHeight) / 2;
// Crop
BufferedImage croppedImage = img.getSubimage(x, y, targetWidth, targetHeight);
/*BufferedImage croppedImage = img.getSubimage(
xc,
yc,
targetWidth, // widht
targetHeight // height
);*/
return croppedImage;
}
public void run() {
for (int i=0;i<active_stamps.size();i++) {
Stamp s = active_stamps.get(i);
if (!s.run()) {
active_stamps.remove(i--);
}
}
}
public static void checkForStamp(String user,String message) {
boolean foundmatch = false;
message = message.toLowerCase().replaceAll("[ ]", "");
if (message.length()>480) {
return;
}
for (String key : image_map.keySet()) {
for (String message_search : stamp_map.get(key)) {
String filteredmessage = message;
filteredmessage = filteredmessage.replaceAll("[^A-Za-z0-9]","");
if (filteredmessage.contains("gettinginteresting") &&
message_search.equalsIgnoreCase("interesting")) {
break;
}
if (filteredmessage.contains("notready") &&
message_search.equalsIgnoreCase("ready")) {
break;
}
//System.out.println(filteredmessage);
if (message_search.contains("?") || message_search.contains("!")
|| message_search.contains(".") || message_search.contains(":")) {
if (message.contains(message_search)) {
foundmatch = true;
CreateStamp(key);
System.out.println("Stamp "+key+" created by user "+user+" MESSAGE:"+message+".");
break;
}
} else {
if (filteredmessage.contains(message_search)) {
foundmatch=true;
CreateStamp(key);
System.out.println("Stamp "+key+" created by user "+user+" MESSAGE:"+message+".");
break;
}
}
}
if (foundmatch) {
break;
}
}
}
public static void CreateStamp(String stamp_name) {
final int STAMP_DURATION = 180;
String soundName = sigIRC.BASEDIR+"sigIRC/sounds/stamp_sound.wav";
FileManager manager = new FileManager("sigIRC/sounds/stamp_sound.wav");
manager.verifyAndFetchFileFromServer();
SoundUtils.playSound(soundName);
active_stamps.add(new Stamp(image_map.get(stamp_name),STAMP_DURATION));
}
public void ApplyConfigWindowProperties() {
sigIRC.bandorimodule_X=(int)position.getX();
sigIRC.bandorimodule_Y=(int)position.getY();
sigIRC.config.setInteger("BANDORI_module_X", sigIRC.bandorimodule_X);
sigIRC.config.setInteger("BANDORI_module_Y", sigIRC.bandorimodule_Y);
}
public void windowClosed(WindowEvent ev) {
}
public void draw(Graphics g) {
super.draw(g);
if (sigIRC.panel!=null) {
for (Stamp s : active_stamps) {
//Stamp is 130x107 pixels
if (s.scheme instanceof SingleImageScheme) {
g.drawImage(s.scheme.base,(int)(s.randX+position.getX()),(int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107,0,0,
s.scheme.base.getWidth(),s.scheme.base.getHeight(),sigIRC.panel);
} else {
g.drawImage(s.scheme.base, (int)(s.randX+position.getX()), (int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107,
s.scheme.stamp_index%6*270+4, s.scheme.stamp_index/6*223+3, s.scheme.stamp_index%6*270+260+4, s.scheme.stamp_index/6*223+214+3, sigIRC.panel);
}
}
Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()+24);
double successChance = 1;
DecimalFormat df = new DecimalFormat("0");
DecimalFormat df2 = new DecimalFormat("0.0");
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()-24, 2, Color.WHITE, Color.BLACK, songtitle);
for (int i=0;i<parts.size();i++) {
SongPart s = parts.get(i);
if (s.getTotal()!=0) {
double successRate = (double)s.getSuccesses()/s.getTotal();
successChance *= successRate;
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()+i*24, 2, Color.WHITE, Color.BLACK, s.getTitle()+" - "+s.getSuccesses()+"/"+s.getTotal()+" ("+df.format(successRate*100)+"%)");
}
}
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()+parts.size()*24+8, 2, Color.WHITE, Color.BLACK, "Expected Attempts: "+(df.format(1d/successChance))+" Success Chance: "+df2.format((successChance)*100)+"%");
}
}
public void keypressed(KeyEvent ev) {
super.keypressed(ev);
switch (ev.getKeyCode()) {
case KeyEvent.VK_CONTROL:{
holdControl=true;
System.out.println("Pressed Control");
}break;
case KeyEvent.VK_ALT:{
holdAlt=true;
System.out.println("Pressed Alt");
}break;
case KeyEvent.VK_HOME:{
String input = pane.showInputDialog(sigIRC.window, "Song Title:", songtitle);
this.songtitle = input;
}break;
case KeyEvent.VK_1:{
if (holdControl) {
SetupPart(0);
} else {
AddtoAllParts(0);
}
}break;
case KeyEvent.VK_2:{
if (holdControl) {
SetupPart(1);
} else {
AddtoAllParts(1);
}
}break;
case KeyEvent.VK_3:{
if (holdControl) {
SetupPart(2);
} else {
AddtoAllParts(2);
}
}break;
case KeyEvent.VK_4:{
if (holdControl) {
SetupPart(3);
} else {
AddtoAllParts(3);
}
}break;
}
}
private void AddtoAllParts(int partnumb) {
for (int i=0;i<=partnumb;i++) {
parts.get(i).AddtoTrials(holdAlt);
}
}
private void SetupPart(int partnumb) {
String input = pane.showInputDialog(sigIRC.window,"Name Part 1:",parts.get(partnumb).getTitle());
String input2 = pane.showInputDialog(sigIRC.window,"Provide Success/Total Count (X/Y Format)",parts.get(partnumb).getSuccesses()+"/"+parts.get(partnumb).getTotal());
if (input.length()>0) {
parts.get(partnumb).setTitle(input);
parts.get(partnumb).setSuccesses(Integer.parseInt(input2.split("/")[0]));
parts.get(partnumb).setTrials(Integer.parseInt(input2.split("/")[1]));
}
holdControl=holdAlt=false;
}
public void keyreleased(KeyEvent ev) {
super.keyreleased(ev);
switch (ev.getKeyCode()) {
case KeyEvent.VK_CONTROL:{
holdControl=false;
System.out.println("Released Control");
}break;
case KeyEvent.VK_ALT:{
holdAlt=false;
System.out.println("Released Alt");
}break;
}
}
}
class Stamp{
ImageScheme scheme;
int timer;
int randX = (int)(Math.random()*(BandoriModule.bandori_module.position.getWidth()-130));
Stamp(ImageScheme scheme,int start_timer) {
this.scheme = scheme;
this.timer = start_timer;
}
public boolean run() {
return --timer>0;
}
}
class ImageScheme{
BufferedImage base;
int stamp_index; //0-23.
ImageScheme(BufferedImage base,int index) {
this.base=base;
this.stamp_index=index;
}
}
class SingleImageScheme extends ImageScheme{
SingleImageScheme(BufferedImage base) {
super(base, 0);
}
}

@ -2,6 +2,7 @@ package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.geom.Rectangle2D;
@ -51,6 +52,26 @@ public class ChatLogModule extends Module{
}
}
public static void loadModule() {
sigIRC.modules.add(new ChatLogModule(
new Rectangle(sigIRC.chatlogmodule_X,sigIRC.chatlogmodule_Y,sigIRC.chatlogmodule_width,sigIRC.chatlogmodule_height),
"Chat Log"
));
sigIRC.chatlogmodule_enabled=true;
sigIRC.config.setBoolean("Module_chatlog_Enabled", sigIRC.chatlogmodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof ChatLogModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.chatlogmodule_enabled=false;
sigIRC.config.setBoolean("Module_chatlog_Enabled", sigIRC.chatlogmodule_enabled);
sigIRC.config.saveProperties();
}
public void run() {
super.run();
if (delay>0 && sigIRC.subEmotesCompleted) {

@ -74,9 +74,11 @@ public class ControllerModule extends Module{
final static int RESIZE_BORDER = 5;
final static double MINIMUM_ELEMENT_SIZE=8;
boolean proportionalResize=false;
public static ControllerModule controller_module;
public ControllerModule(Rectangle2D bounds, String moduleName) {
super(bounds, moduleName);
ControllerModule.controller_module = this;
if (!GLFW.glfwInit()) {
System.out.println("Failed to initialize GLFW!");
} else {
@ -101,8 +103,31 @@ public class ControllerModule extends Module{
}
//buttons.add(new Button(0.1,0.05,0.1,0.05,controllers.get(0),Identifier.Button._3,Color.RED,this));
LoadButtonAndAxisData();
click_buttons.add(new AddClickableButton(new Rectangle(
0,(int)position.getHeight()-21,96,20),"Add Button",this));
if (sigIRC.showWindowControls) {
click_buttons.add(new AddClickableButton(new Rectangle(
0,(int)position.getHeight()-21,96,20),"Add Button",this));
}
}
public static void loadModule() {
sigIRC.modules.add(new ControllerModule(
new Rectangle(sigIRC.controllermodule_X,sigIRC.controllermodule_Y,sigIRC.controllermodule_width,sigIRC.controllermodule_height),
"Controller"
));
sigIRC.controllermodule_enabled=true;
sigIRC.config.setBoolean("Module_controller_Enabled", sigIRC.controllermodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof ControllerModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.controllermodule_enabled=false;
sigIRC.config.setBoolean("Module_controller_Enabled", sigIRC.controllermodule_enabled);
sigIRC.config.saveProperties();
}
public List<Controller> getControllers() {
@ -380,106 +405,108 @@ public class ControllerModule extends Module{
public void run() {
Point mouse_position = new Point((int)(sigIRC.panel.lastMouseX-getPosition().getX()),(int)(sigIRC.panel.lastMouseY-getPosition().getY()));
if (resizing) {
PerformResize(mouse_position);
setConstraints();
}
if (dragging) {
selectedElement.setBounds(new Rectangle2D.Double((mouse_position.getX()+xoffset)/controller_img.getWidth(sigIRC.panel),
(mouse_position.getY()+yoffset)/controller_img.getHeight(sigIRC.panel),
selectedElement.getBounds().getWidth(),
selectedElement.getBounds().getHeight()));
setConstraints();
}
if (!inDragZone && selectedElement==null) {
if (findMouseoverElement(mouse_position)!=null) {
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.HAND_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.HAND_CURSOR));
}
} else {
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.DEFAULT_CURSOR &&
!inDragZone) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
if (sigIRC.showWindowControls) {
if (resizing) {
PerformResize(mouse_position);
setConstraints();
}
}
if (selectedElement!=null && extendBoundaries(selectedElement.getPixelBounds(controller_img),3).contains(mouse_position)) {
if (!resizing) {
resizing_direction=0;
if (mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()<=RESIZE_BORDER &&
mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()>=-RESIZE_BORDER) {
resizing_direction+=1;
} else
if (mouse_position.getY()-(selectedElement.getPixelBounds(controller_img).getY()+selectedElement.getPixelBounds(controller_img).getHeight())<=RESIZE_BORDER &&
mouse_position.getY()-(selectedElement.getPixelBounds(controller_img).getY()+selectedElement.getPixelBounds(controller_img).getHeight())>=-RESIZE_BORDER) {
resizing_direction+=4;
}
if (mouse_position.getX()-selectedElement.getPixelBounds(controller_img).getX()<=RESIZE_BORDER &&
mouse_position.getX()-selectedElement.getPixelBounds(controller_img).getX()>=-RESIZE_BORDER) {
resizing_direction+=8;
} else
if (mouse_position.getX()-(selectedElement.getPixelBounds(controller_img).getX()+selectedElement.getPixelBounds(controller_img).getWidth())<=RESIZE_BORDER &&
mouse_position.getX()-(selectedElement.getPixelBounds(controller_img).getX()+selectedElement.getPixelBounds(controller_img).getWidth())>=-RESIZE_BORDER) {
resizing_direction+=2;
}
if (dragging) {
selectedElement.setBounds(new Rectangle2D.Double((mouse_position.getX()+xoffset)/controller_img.getWidth(sigIRC.panel),
(mouse_position.getY()+yoffset)/controller_img.getHeight(sigIRC.panel),
selectedElement.getBounds().getWidth(),
selectedElement.getBounds().getHeight()));
setConstraints();
}
switch (resizing_direction) {
case 1:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.N_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
}
}break;
case 2:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.E_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
}
}break;
case 3:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.NE_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
}
}break;
case 6:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.SE_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
}
}break;
case 4:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.S_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
}
}break;
case 12:{
if (!inDragZone && selectedElement==null) {
if (findMouseoverElement(mouse_position)!=null) {
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.SW_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
if (cursortype!=Cursor.HAND_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.HAND_CURSOR));
}
}break;
case 8:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.W_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
}
}break;
case 9:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.NW_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
}
}break;
default:
} else {
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.DEFAULT_CURSOR &&
!inDragZone) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
}
if (selectedElement!=null && extendBoundaries(selectedElement.getPixelBounds(controller_img),3).contains(mouse_position)) {
if (!resizing) {
resizing_direction=0;
if (mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()<=RESIZE_BORDER &&
mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()>=-RESIZE_BORDER) {
resizing_direction+=1;
} else
if (mouse_position.getY()-(selectedElement.getPixelBounds(controller_img).getY()+selectedElement.getPixelBounds(controller_img).getHeight())<=RESIZE_BORDER &&
mouse_position.getY()-(selectedElement.getPixelBounds(controller_img).getY()+selectedElement.getPixelBounds(controller_img).getHeight())>=-RESIZE_BORDER) {
resizing_direction+=4;
}
if (mouse_position.getX()-selectedElement.getPixelBounds(controller_img).getX()<=RESIZE_BORDER &&
mouse_position.getX()-selectedElement.getPixelBounds(controller_img).getX()>=-RESIZE_BORDER) {
resizing_direction+=8;
} else
if (mouse_position.getX()-(selectedElement.getPixelBounds(controller_img).getX()+selectedElement.getPixelBounds(controller_img).getWidth())<=RESIZE_BORDER &&
mouse_position.getX()-(selectedElement.getPixelBounds(controller_img).getX()+selectedElement.getPixelBounds(controller_img).getWidth())>=-RESIZE_BORDER) {
resizing_direction+=2;
}
}
switch (resizing_direction) {
case 1:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.N_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
}
}break;
case 2:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.E_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
}
}break;
case 3:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.NE_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
}
}break;
case 6:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.SE_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
}
}break;
case 4:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.S_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
}
}break;
case 12:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.SW_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
}
}break;
case 8:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.W_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
}
}break;
case 9:{
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.NW_RESIZE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
}
}break;
default:
int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.DEFAULT_CURSOR &&
!inDragZone) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
}
}
for (Controller c : controllers) {

@ -0,0 +1,303 @@
package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.imageio.ImageIO;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import sig.Module;
import sig.sigIRC;
import sig.modules.Controller.Controller;
public class DDRStepModule extends Module{
public static DDRStepModule step_module;
ControllerModule controller;
Controller cont;
AudioInputStream songStream,metronomeStream;
Clip audioClip,metronomeClick;
int bpm=180;
int lastsystemtime = 0;
int lastnotetime = 0;
int offset = 0;
int framecounter = 0;
Image arrow_img1,arrow_img2;
byte[] lastbuttonstate = new byte[]{0,0,0,0,0,0};
boolean[] lastpressedstate = new boolean[]{false,false,false,false,false,false};
List<Note> notelist = new ArrayList<Note>();
boolean notepressed=false;
int notespd = 256;
public DDRStepModule(Rectangle2D bounds, String moduleName) {
this(bounds,moduleName,true);
}
public DDRStepModule(Rectangle2D bounds, String moduleName, boolean enabled) {
super(bounds, moduleName, enabled);
Initialize();
}
void Initialize() {
DDRStepModule.step_module = this;
if (sigIRC.controllermodule_enabled) {
try {
metronomeStream = AudioSystem.getAudioInputStream(new File(sigIRC.BASEDIR+"sigIRC/sounds/tick.wav"));
try {
metronomeClick = AudioSystem.getClip();
metronomeClick.open(metronomeStream);
} catch (LineUnavailableException e) {
e.printStackTrace();
}
} catch (UnsupportedAudioFileException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
controller = ControllerModule.controller_module;
cont = controller.getControllers().get(0);
try {
arrow_img1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/ddr_notes1.png"));
arrow_img2 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/ddr_notes2.png"));
} catch (IOException e) {
e.printStackTrace();
}
} else {
System.out.println("Cannot initialize DDRStepModule due to Controller Module being disabled!");
this.enabled = false;
}
}
public static void loadModule() {
sigIRC.modules.add(new DDRStepModule(
new Rectangle(sigIRC.ddrstepmodule_X,sigIRC.ddrstepmodule_Y,sigIRC.ddrstepmodule_width,sigIRC.ddrstepmodule_height),
"DDR Step"
));
sigIRC.ddrstepmodule_enabled=true;
sigIRC.config.setBoolean("Module_ddrstep_Enabled", sigIRC.ddrstepmodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof DDRStepModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.ddrstepmodule_enabled=false;
sigIRC.config.setBoolean("Module_ddrstep_Enabled", sigIRC.ddrstepmodule_enabled);
sigIRC.config.saveProperties();
}
public void run() {
super.run();
if (cont!=null) {
//System.out.println(cont.outputButtons());
/* Start = 1
Select = 0
Up = 5
Right = 2
Left = 4
Down = 3
*/
//System.out.println((System.currentTimeMillis()-(1000/(bpm/60d)))+"/"+lastsystemtime);
if (audioClip!=null &&
audioClip.isRunning() && lastsystemtime<audioClip.getFramePosition()-(44100/(bpm/60d))) {
//System.out.print("Tick. ");
lastsystemtime += (44100/(bpm/60d));
//metronomeClick.loop(Clip.LOOP_CONTINUOUSLY);
metronomeClick.stop();
metronomeClick.setFramePosition(0);
metronomeClick.start();
} //METRONOME CODE.
if (audioClip!=null &&
audioClip.isRunning() && lastnotetime<audioClip.getFramePosition()-(44100/((bpm*2)/60d))) {
//System.out.print("Tick. ");
lastnotetime += (44100/((bpm*2)/60d));
for (int i=0;i<6;i++) {
lastpressedstate[i]=false;
}
}
if (audioClip!=null && audioClip.isRunning()) {
framecounter++;
System.out.println(audioClip.getFramePosition());
//UP
//44100Hz = 1 second
}
byte[] buttons = cont.getButtons();
HandleButton(BUTTONDIR.UP,buttons);
HandleButton(BUTTONDIR.DOWN,buttons);
HandleButton(BUTTONDIR.LEFT,buttons);
HandleButton(BUTTONDIR.RIGHT,buttons);
}
}
void HandleButton(BUTTONDIR button, byte[] buttons) {
if (lastbuttonstate[button.getButton()]==0 && buttons[button.getButton()]==1) {
System.out.println(button+" Pressed"/* at "+audioClip.getFramePosition()*/);
lastbuttonstate[button.getButton()] = buttons[button.getButton()];
if (!lastpressedstate[button.button]) {
lastpressedstate[button.button]=true;
notelist.add(new Note(lastnotetime,button.getNote()));
}
} else
if (lastbuttonstate[button.getButton()]==1 && buttons[button.getButton()]==0) {
System.out.println(button+" Released"/* at "+audioClip.getFramePosition()*/);
lastbuttonstate[button.getButton()] = buttons[button.getButton()];
}
}
class Note{
int framePosition;
//(44100/(bpm/60d)) = Quarter Note Snapping
//(44100/((bpm*2)/60d)) = Eighth Note Snapping
NOTEPROPERTIES direction;
Note(int framePosition, NOTEPROPERTIES direction) {
this.framePosition = framePosition;
this.direction = direction;
}
}
enum NOTEPROPERTIES{
UP(0,2),
DOWN(-64,1),
LEFT(-128,0),
RIGHT(64,3);
int xoffset,subimage;
NOTEPROPERTIES(int xoffset,int subimage) {
this.xoffset = xoffset;
this.subimage = subimage;
}
int getXOffset() {
return xoffset;
}
int getSubimage() {
return subimage;
}
}
enum BUTTONDIR{
UP(5,NOTEPROPERTIES.UP),
DOWN(3,NOTEPROPERTIES.DOWN),
LEFT(4,NOTEPROPERTIES.LEFT),
RIGHT(2,NOTEPROPERTIES.RIGHT);
int button;
NOTEPROPERTIES note;
BUTTONDIR(int button, NOTEPROPERTIES note) {
this.button = button;
this.note = note;
}
int getButton() {
return button;
}
NOTEPROPERTIES getNote() {
return note;
}
}
public void draw(Graphics g) {
super.draw(g);
Point initialP = new Point((int)this.position.getCenterX()-arrow_img1.getWidth(sigIRC.window)/2,(int)this.position.getY()+(int)this.position.getHeight());
g.drawImage(arrow_img1, (int)this.position.getCenterX()-arrow_img1.getWidth(sigIRC.window)/2, (int)this.position.getY()+(int)this.position.getHeight(), sigIRC.window);
if (audioClip!=null && audioClip.isRunning()) {
for (int i=notelist.size()-1;i>0;i--) {
Note n = notelist.get(i);
if ((int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d))>this.position.getHeight()) {
break;
}
g.setColor(Color.RED);
g.drawImage(arrow_img2, initialP.x+128+n.direction.xoffset, initialP.y-(int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d)), initialP.x+64+128+n.direction.xoffset, initialP.y+64-(int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d)), n.direction.subimage*64, 0, n.direction.subimage*64+64, 64, new Color(0,0,0,0), sigIRC.window);
}
}
}
public void keypressed(KeyEvent ev) {
super.keypressed(ev);
if (ev.getKeyCode() == ev.VK_OPEN_BRACKET) {
JFileChooser song_choice = new JFileChooser();
int val = song_choice.showOpenDialog(sigIRC.window);
if (val == JFileChooser.APPROVE_OPTION) {
System.out.println("Opening file "+song_choice.getSelectedFile().getAbsolutePath());
}
JOptionPane bpm_pane = new JOptionPane();
String input = bpm_pane.showInputDialog(sigIRC.window,"Input Song BPM:","180");
if (input!=null && input.length()>0) {
bpm = Integer.parseInt(input);
System.out.println("BPM set to "+bpm);
try {
songStream = AudioSystem.getAudioInputStream(new File(song_choice.getSelectedFile().getAbsolutePath()));
try {
if (audioClip!=null && audioClip.isOpen()) {
audioClip.close();
}
audioClip = AudioSystem.getClip();
audioClip.open(songStream);
} catch (LineUnavailableException e) {
e.printStackTrace();
}
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
bpm_pane.showMessageDialog(sigIRC.window,"Press the RIGHT BRACKET button to begin playing.");
} else
if (ev.getKeyCode() == ev.VK_1) {
if (audioClip.isOpen() && !audioClip.isRunning()) {
audioClip.start();
framecounter = audioClip.getFramePosition();
System.out.println("Audio Clip Started.");
lastsystemtime = audioClip.getFramePosition();
lastnotetime = audioClip.getFramePosition();
}
} else
if (ev.getKeyCode() == ev.VK_2) {
if (audioClip.isOpen() && audioClip.isRunning()) {
audioClip.stop();
audioClip.setFramePosition(offset);
System.out.println("Audio Clip Stopped.");
}
} else
if (ev.getKeyCode() == ev.VK_3) {
if (audioClip.isOpen() && audioClip.isRunning()) {
offset = audioClip.getFramePosition();
//audioClip.setMicrosecondPosition(offset);
System.out.println("Set new Offset to "+offset);
}
} else
if (ev.getKeyCode() == ev.VK_4) {
if (audioClip.isOpen() && !audioClip.isRunning()) {
framecounter = 0;
audioClip.setFramePosition(0);
System.out.println("Reset offset to 0.");
}
}
}
}

@ -0,0 +1,10 @@
package sig.modules;
public class MapPoint {
int timer;
String player;
public MapPoint(int timer, String player) {
this.timer=timer;
this.player=player;
}
}

@ -0,0 +1,81 @@
package sig.modules.RabiRace;
import java.awt.Color;
public enum ColorLocation {
UNKNOWN(0,"Unknown",52,52,52),
STARTING_FOREST(1,"Starting Forest",110,181,103),
SPECTRAL_CAVE(2,"Spectral Cave",97,103,162),
FORGOTTEN_CAVE(3,"Forgotten Cave",135,110,75),
NATURAL_AQUARIUM(4,"Natural Aquarium",128,169,115),
DLC2BOSSARENA(5,"Boss Arena",255,255,255),
FORGOTTENCAVEII(6,"Forgotten Cave II",146,108,109),
UPPERFOREST(7,"Upper Forest",0,128,84),
BLANK(8,"???",52,52,52),
RABIRABIBEACH(9,"Rabi Rabi Beach",98,135,193),
GOLDENPYRAMID(10,"Golden Pyramid",198,161,75),
RABIRABIRAVINE(11,"Rabi Rabi Ravine",110,181,103),
RABIRABITOWN(12,"Rabi Rabi Town",217,145,126),
RABIRABIPARK(13,"Rabi Rabi Park",181,110,103),
UPRPRCBASE(14,"UPRPRC Base",110,110,181),
SKYISLANDTOWN(15,"Sky Island Town",142,105,150),
AZURESNOWLAND(16,"Azure Snowland",142,105,235),
SYSTEMINTERIORI(17,"System Interior I",104,156,207),
EVERNIGHTPEAK(18,"Evernight Peak",75,97,210),
EXOTICLAB(19,"Exotic Laboratory",175,103,134),
GOLDENRIVERBANK(20,"Golden Riverbank",206,156,105),
FLOATINGGRAVEYARD(21,"Floating Graveyard",180,59,54),
SYSTEMINTERIORII(22,"System Interior II",212,77,86),
AURORAPALACE(23,"Aurora Palace",34,169,209),
FLOATINGLIBRARY(24,"Floating Library",118,198,166),
NATURALAQUARIUM(25,"Natural Aquarium",128,169,115),
SKYHIGHBRIDGE(26,"Sky-High Bridge",106,195,182),
WARPDESTINATION(27,"Warp Destination",138,178,88),
VOLCANICCAVERNS(28,"Volcanic Caverns",186,45,42),
PLURKWOOD(29,"Plurkwood",195,98,45),
HALLOFMEMORIES(30,"Hall of Memories",64,99,164),
ICYSUMMIT(31,"Icy Summit",45,104,146),
HALLOFMEMORIESII(32,"Hall of Memories II",220,143,64),
HALLOWEENAREA(34,"Halloween Area",121,55,53),
HOSPITAL(50,"Hospital",97,97,136),
RABIRABIRAVINEII(55,"Rabi Rabi Ravine II",42,184,120),
NOAH3BOSSARENA(81,"Noah 3 Boss Arena",52,52,52),
NOAH1BOSSARENA(83,"Noah 1 Boss Arena",52,52,52),
RUMIBOSSARENA(87,"Rumi Boss Arena",203,125,122),
HALLOFMEMORIES21(95,"Hall of Memories II",255,255,0),
HALLOFMEMORIES22(96,"Hall of Memories II",255,255,0),
HALLOFMEMORIES23(97,"Hall of Memories II",255,255,0),
HALLOFMEMORIES24(98,"Hall of Memories II",255,255,0),
;
int color;
String name;
Color colorval;
ColorLocation(int val, String name, int r, int g, int b) {
color = val;
this.name=name;
this.colorval = new Color(r,g,b);
}
public static Color getColor(int id) {
for (ColorLocation cl : ColorLocation.values()) {
if (cl.color == id) {
return cl.colorval;
}
}
return null;
}
public static String getLocationName(int id) {
for (ColorLocation cl : ColorLocation.values()) {
if (cl.color == id) {
return cl.name;
}
}
return "";
}
}

@ -21,9 +21,10 @@ public class JoinButton extends ClickableButton{
if (RabiRaceModule.mySession==null) {
RabiRaceModule.module.window.setVisible(true);
} else {
//RabiRaceModule.module.LeaveSession();
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=leavesession&name="+RabiRaceModule.module.myProfile.username+"&session="+RabiRaceModule.mySession.id),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=leavesession&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+RabiRaceModule.module.myProfile.username+"&session="+RabiRaceModule.mySession.id),file);
RabiRaceModule.mySession=null;
} catch (MalformedURLException e) {
e.printStackTrace();

@ -0,0 +1,26 @@
package sig.modules.RabiRace;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import sig.Module;
import sig.sigIRC;
import sig.modules.RabiRaceModule;
public class MarkMapButton extends ClickableButton{
public MarkMapButton(Rectangle position, String button_label, RabiRaceModule module) {
super(position,button_label,module);
}
public void onClickEvent(MouseEvent ev) {
if (RabiRaceModule.module.mySession!=null) {
//System.out.println("Mark Map.");
RabiRaceModule.module.MarkCurrentPosition();
}
}
}

@ -42,6 +42,7 @@ public enum MemoryData {
CHARGE_RING(MemoryOffset.CHARGE_RING,"Charge Ring","charge_ring.png",true),
CARROT_SHOOTER(MemoryOffset.CARROT_SHOOTER,"Carrot Shooter","carrot_shooter.png",true),
SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true),
GOLD_CARROT(MemoryOffset.GOLD_CARROT,"Gold Carrot","gold_carrot.png",true),
/*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true),
DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true),
DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/

@ -5,6 +5,7 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@ -23,24 +24,28 @@ import java.util.Random;
import sig.ScrollingText;
import sig.sigIRC;
import sig.modules.RabiRaceModule;
import sig.modules.RabiRibi.MemoryOffset;
import sig.utils.DrawUtils;
import sig.utils.FileUtils;
import sig.utils.TextUtils;
public class Profile {
public static final int EVENT_COUNT = 265;
public String username = sigIRC.nickname.toLowerCase();
public String displayName = sigIRC.nickname;
public Avatar avatar;
public int playtime = 0;
public int healthUps = 0;
public int attackUps = 0;
public int manaUps = 0;
public int regenUps = 0;
public int packUps = 0;
public int rainbowEggCount = 0;
public String healthUps = "0000000000000000000000000000000000000000000000000000000000000000";
public String attackUps = "0000000000000000000000000000000000000000000000000000000000000000";
public String manaUps = "0000000000000000000000000000000000000000000000000000000000000000";
public String regenUps = "0000000000000000000000000000000000000000000000000000000000000000";
public String packUps = "0000000000000000000000000000000000000000000000000000000000000000";
public String eventStruct = "0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_";
public int rainbowEggs = 0;
public boolean isPaused = false;
public int difficulty = 0;
public int loop = 0;
public int map = 0; //Map color.
public float itempct = 0;
public float mappct = 0;
public LinkedHashMap<MemoryData,Integer> key_items = new LinkedHashMap<MemoryData,Integer>();
@ -56,6 +61,8 @@ public class Profile {
public Image imageDisplayUpdateImage;
public boolean stat_update_required = true;
public boolean image_display_update_required = true;
public int timeKey = -1;
public boolean syncing = false;
public Profile(RabiRaceModule module) {
this(module,true);
@ -79,7 +86,7 @@ public class Profile {
oldProfile.manaUps = manaUps;
oldProfile.regenUps = regenUps;
oldProfile.packUps = packUps;
oldProfile.rainbowEggCount = rainbowEggCount;
oldProfile.rainbowEggs = rainbowEggs;
oldProfile.key_items = (LinkedHashMap<MemoryData, Integer>)key_items.clone();
oldProfile.badges = (LinkedHashMap<MemoryData, Integer>)badges.clone();
oldProfile.playtime = playtime;
@ -102,7 +109,7 @@ public class Profile {
if (oldProfile.packUps!=packUps) {
count++;
}
if (oldProfile.rainbowEggCount!=rainbowEggCount) {
if (oldProfile.rainbowEggs!=rainbowEggs) {
count++;
}
for (MemoryData md : key_items.keySet()) {
@ -128,6 +135,76 @@ public class Profile {
return count;
}
public static int GetHealthUpCount(Profile p) {
int numb = 0;
for (int i=0;i<p.healthUps.length();i++) {
if (p.healthUps.charAt(i)=='1') {
numb++;
}
}
return numb;
}
public static int GetManaUpCount(Profile p) {
int numb = 0;
for (int i=0;i<p.manaUps.length();i++) {
if (p.manaUps.charAt(i)=='1') {
numb++;
}
}
return numb;
}
public static int GetRegenUpCount(Profile p) {
int numb = 0;
for (int i=0;i<p.regenUps.length();i++) {
if (p.regenUps.charAt(i)=='1') {
numb++;
}
}
return numb;
}
public static int GetPackUpCount(Profile p) {
int numb = 0;
for (int i=0;i<p.packUps.length();i++) {
if (p.packUps.charAt(i)=='1') {
numb++;
}
}
return numb;
}
public static int GetAttackUpCount(Profile p) {
int numb = 0;
for (int i=0;i<p.attackUps.length();i++) {
if (p.attackUps.charAt(i)=='1') {
numb++;
}
}
return numb;
}
public static int GetRainbowEggCount(Profile p) {
return p.rainbowEggs;
}
public void MarkCurrentPosition() {
int id = RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_TILE_Y)+18*RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_TILE_X)+RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_AREA_NUMBER)*450;
if (RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_REGION_START.getOffset()+id*4)>1 &&
RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_REGION_START.getOffset()+id*4)!=3 &&
RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_REGION_START.getOffset()+id*4)!=7
&& !RabiRaceModule.module.mapdata.containsKey(id)) {
RabiRaceModule.module.AddMapPoint(RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_AREA_NUMBER),
RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_TILE_X),
RabiRaceModule.module.readIntFromMemory(MemoryOffset.MAP_TILE_Y),
16,false);
}
/*for (int i=0;i<17;i++) {
AddMapPoint(0,i,0,i);
}*/
}
public void compareAndAnnounceAllChangedValues() {
//System.out.println(oldProfile.key_items.get(MemoryData.HAMMER)+","+key_items.get(MemoryData.HAMMER));
int changedValueCount = compareAllChangedValues();
@ -135,45 +212,52 @@ public class Profile {
return;
}
String announcement = "";
if (oldProfile.healthUps==healthUps-1) {
announcement = "has obtained a Health Up! ("+healthUps+" total)";
if (GetHealthUpCount(oldProfile)==GetHealthUpCount(this)-1) {
announcement = "has obtained a Health Up! ("+GetHealthUpCount(this)+" total)";
MarkCurrentPosition();
}
if (oldProfile.attackUps==attackUps-1) {
announcement = "has obtained an Attack Up! ("+attackUps+" total)";
if (GetAttackUpCount(oldProfile)==GetAttackUpCount(this)-1) {
announcement = "has obtained an Attack Up! ("+GetAttackUpCount(this)+" total)";
MarkCurrentPosition();
}
if (oldProfile.manaUps==manaUps-1) {
announcement = "has obtained a Mana Up! ("+manaUps+" total)";
if (GetManaUpCount(oldProfile)==GetManaUpCount(this)-1) {
announcement = "has obtained a Mana Up! ("+GetManaUpCount(this)+" total)";
MarkCurrentPosition();
}
if (oldProfile.regenUps==regenUps-1) {
announcement = "has obtained a Regen Up! ("+regenUps+" total)";
if (GetRegenUpCount(oldProfile)==GetRegenUpCount(this)-1) {
announcement = "has obtained a Regen Up! ("+GetRegenUpCount(this)+" total)";
MarkCurrentPosition();
}
if (oldProfile.packUps==packUps-1) {
announcement = "has obtained a Pack Up! ("+packUps+" total)";
if (GetPackUpCount(oldProfile)==GetPackUpCount(this)-1) {
announcement = "has obtained a Pack Up! ("+GetPackUpCount(this)+" total)";
MarkCurrentPosition();
}
if (oldProfile.rainbowEggCount==rainbowEggCount-1) {
if (GetRainbowEggCount(oldProfile)==GetRainbowEggCount(this)-1) {
if (RabiRaceModule.mySession!=null &&
RabiRaceModule.mySession.gamemode==0 &&
RabiRaceModule.mySession.eggCount>0) {
if (RabiRaceModule.mySession.eggCount-rainbowEggCount==0) {
announcement = "has obtained "+RabiRaceModule.mySession.eggCount+" Rainbow Eggs! (NAME) has completed the race!";
} else if (RabiRaceModule.mySession.eggCount-rainbowEggCount>0)
RabiRaceModule.mySession.rainbowEggGoal>0) {
if (RabiRaceModule.mySession.rainbowEggGoal-GetRainbowEggCount(this)==0) {
announcement = "has obtained "+RabiRaceModule.mySession.rainbowEggGoal+" Rainbow Eggs! (NAME) has completed the race!";
} else if (RabiRaceModule.mySession.rainbowEggGoal-GetRainbowEggCount(this)>0)
{
announcement = "has obtained a Rainbow Egg! ("+Math.max(RabiRaceModule.mySession.eggCount-rainbowEggCount, 0)+" to go!)";
announcement = "has obtained a Rainbow Egg! ("+Math.max(RabiRaceModule.mySession.rainbowEggGoal-GetRainbowEggCount(this), 0)+" to go!)";
}
} else {
announcement = "has obtained a Rainbow Egg! ("+rainbowEggCount+" total)";
announcement = "has obtained a Rainbow Egg! ("+rainbowEggs+" total)";
}
}
for (MemoryData md : key_items.keySet()) {
if (!oldProfile.key_items.containsKey(md) &&
key_items.containsKey(md)) {
announcement = "has obtained "+md.name+"!";
MarkCurrentPosition();
}
}
for (MemoryData md : badges.keySet()) {
if (!oldProfile.badges.containsKey(md) &&
badges.containsKey(md)) {
announcement = "has obtained the "+md.name+" badge!";
MarkCurrentPosition();
}
}
if (announcement.length()>0 && changedValueCount!=0) {
@ -187,7 +271,7 @@ public class Profile {
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=addupdate&session="+RabiRaceModule.mySession.id+"&message="+string),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=addupdate&session="+RabiRaceModule.mySession.id+"&message="+string),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
@ -214,18 +298,104 @@ public class Profile {
badges.remove(md);
}
}
String[] previousEventStruct = eventStruct.split("_");
StringBuilder events = new StringBuilder();
if (parent.readIntFromMemory(MemoryOffset.PLAYERHEALTH)<=0) {
RabiRaceModule.syncEvents=false;
RabiRaceModule.hasDied=true;
}
if (!RabiRaceModule.syncEvents && RabiRaceModule.hasDied && parent.readIntFromMemory(MemoryOffset.PLAYERHEALTH)>0) {
RabiRaceModule.syncEvents=true;
RabiRaceModule.hasDied=false;
}
/*
if (parent.readIntFromMemory(MemoryOffset.DARKNESS)>0 && RabiRaceModule.syncEvents) {
RabiRaceModule.syncEvents=false;
}
if (!RabiRaceModule.syncEvents && !RabiRaceModule.darknessHasReachedzero &&
parent.readIntFromMemory(MemoryOffset.DARKNESS)==0) {
RabiRaceModule.darknessHasReachedzero=true;
}
if (!RabiRaceModule.syncEvents && RabiRaceModule.darknessHasReachedzero &&
parent.readIntFromMemory(MemoryOffset.DARKNESS)>0) {
RabiRaceModule.syncEvents=true;
RabiRaceModule.darknessHasReachedzero=false;
}*/
RabiRaceModule.syncEvents = !InBossBattleSong();
/*if (parent.readIntFromMemory(MemoryOffset.DARKNESS)>0 && RabiRaceModule.darknessHasReachedzero) {
RabiRaceModule.syncEvents=!RabiRaceModule.syncEvents;
RabiRaceModule.darknessHasReachedzero=false;
}
if (parent.readIntFromMemory(MemoryOffset.DARKNESS)==0) {
RabiRaceModule.darknessHasReachedzero=true;
}*/
for (int i=0;i<EVENT_COUNT;i++) {
if (NonRestrictedValue(i)) {
int val = parent.readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4);
events.append(val);
events.append("_");
} else {
if (RabiRaceModule.syncEvents) {
events.append(parent.readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4));
events.append("_");
} else {
events.append(0);
events.append("_");
}
}
/*if (val>9 || val<0) {
//System.out.println("WARNING! Event "+(256+i)+" has a value greater than 9 or negative number! Truncating to 1 value.");
events.append(Integer.toString(val).charAt(0));
} else {
events.append(val);
}*/
}
if (RabiRaceModule.syncEvents &&
RabiRaceModule.lastEventString.equalsIgnoreCase(events.toString())) {
eventStruct = events.toString();
} else {
RabiRaceModule.lastEventString = events.toString();
}
syncing = RabiRaceModule.syncEvents;
}
private boolean InBossBattleSong() {
for (int i=0;i<RabiRaceModule.BOSSSONGS.length;i++) {
if (parent.readIntFromMemory(MemoryOffset.MAP_AREA_COLOR)==RabiRaceModule.BOSSSONGS[i]) {
return true;
}
}
return false;
}
private boolean NonRestrictedValue(int i) {
for (int j=0;j<RabiRaceModule.RESTRICTED_EVENTS.length;j++) {
if (i==RabiRaceModule.RESTRICTED_EVENTS[j]-256) {
return false;
}
}
return true;
}
public void uploadProfile() {
if (sigIRC.authenticated) {
File file = new File(sigIRC.BASEDIR+"tmp");
File file = new File(sigIRC.BASEDIR+"tmp2");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=playerdata&name="+sigIRC.nickname.toLowerCase()+"&data="+getDataString()),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=playerdata&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+sigIRC.nickname.toLowerCase()+"&data="+getDataString()),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
FileUtils.logToFile("["+System.currentTimeMillis()+"]Upload profile. "+"http://45.33.13.215:8080/rabirace/send.php?key=playerdata&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+sigIRC.nickname.toLowerCase()+"&data="+getDataString(), "debug.log");
//System.out.println(getDataString());
//String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"tmp");
//System.out.println(Arrays.toString(data));
}
}
@ -233,31 +403,37 @@ public class Profile {
if (sigIRC.authenticated) {
File file = new File(sigIRC.BASEDIR+"tmp_profile");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=retrievedata&name="+username.toLowerCase()),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=retrievedata&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&retrievename="+username.toLowerCase()+"&name="+sigIRC.nickname.toLowerCase()),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
FileUtils.logToFile("["+System.currentTimeMillis()+"]Download profile w/settings: "+"http://45.33.13.215:8080/rabirace/send.php?key=retrievedata&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&retrievename="+username.toLowerCase()+"&name="+sigIRC.nickname.toLowerCase(), "debug2.log");
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"tmp_profile");
//System.out.println(Arrays.toString(data));
if (data.length>=18) {
if (data.length>=23) {
int i=0;
displayName = data[i++];
try {
avatar = Avatar.getAvatarFromID(Integer.parseInt(data[i++]));
//System.out.println("Updated Avatar for Player "+displayName+" with Avatar "+avatar.displayName);
timeKey = Integer.parseInt(data[i++]);
playtime = Integer.parseInt(data[i++]);
healthUps = Integer.parseInt(data[i++]);
manaUps = Integer.parseInt(data[i++]);
regenUps = Integer.parseInt(data[i++]);
packUps = Integer.parseInt(data[i++]);
attackUps = Integer.parseInt(data[i++]);
rainbowEggCount = Integer.parseInt(data[i++]);
healthUps = data[i++];
manaUps = data[i++];
regenUps = data[i++];
packUps = data[i++];
attackUps = data[i++];
rainbowEggs = Integer.parseInt(data[i++]);
isPaused = Boolean.parseBoolean(data[i++]);
difficulty = Integer.parseInt(data[i++]);
loop = Integer.parseInt(data[i++]);
itempct = Float.parseFloat(data[i++]);
mappct = Float.parseFloat(data[i++]);
} catch (NumberFormatException e) {
return false;
}
i+=2;
String nextval = data[i++];
if (!nextval.equalsIgnoreCase("BADGES:")) {
@ -279,7 +455,16 @@ public class Profile {
}
while (!nextval.equalsIgnoreCase("UPDATES:"));
}
nextval = data[i++];
eventStruct = nextval;
nextval = data[i++];
map = Integer.parseInt(nextval);
nextval = data[i++];
//System.out.println(nextval);
syncing = Boolean.parseBoolean(nextval);
lastWebUpdate = System.currentTimeMillis();
FileUtils.logToFile("["+System.currentTimeMillis()+"]Sync completed syccessfully.", "debug.log");
return true;
}
}
@ -290,13 +475,14 @@ public class Profile {
StringBuilder sb = new StringBuilder();
appendData(sigIRC.nickname,sb);
appendData(avatar.value,sb);
appendData(RabiRaceModule.CLIENT_SERVER_READTIME,sb);
appendData(playtime,sb);
appendData(healthUps,sb);
appendData(manaUps,sb);
appendData(regenUps,sb);
appendData(packUps,sb);
appendData(attackUps,sb);
appendData(rainbowEggCount,sb);
appendData(rainbowEggs,sb);
appendData(isPaused,sb);
appendData(difficulty,sb);
appendData(loop,sb);
@ -314,6 +500,10 @@ public class Profile {
appendData(data.name()+";"+val,sb);
}
appendData("UPDATES:",sb);
appendData(eventStruct,sb);
appendData(map,sb);
appendData(syncing,sb);
appendData("END",sb);
return sb.toString();
}
@ -325,6 +515,7 @@ public class Profile {
}
public static Avatar GetSeededAvatar(String username) {
//System.out.println(RabiRaceModule.mySession.getPlayers());
Random r = new Random();
r.setSeed(username.toLowerCase().hashCode());
int randomnumb = r.nextInt(28);
@ -341,18 +532,24 @@ public class Profile {
//g2.fillRect(1, 1, 32, 32);
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel);
g2.setColor(ScrollingText.GetUserNameColor(displayName));
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName);
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 0, 1, g2.getColor(), Color.BLACK, displayName);
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 0, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
String text = TextUtils.convertSecondsToTimeFormat(playtime/60);
if (!syncing) {
g2.setColor(new Color(196,24,24));
} else
if (isPaused) {
g2.setColor(new Color(128,96,0));
} else {
g2.setColor(Color.BLACK);
}
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 0, 1, g2.getColor(), Color.GRAY, text);
text = "Map "+df.format(mappct)+"% Item "+df.format(itempct)+"%";
//DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(parent.position.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 0, 2, Color.WHITE, Color.BLACK, text);
text = ColorLocation.getLocationName(map);
Rectangle2D siz = TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiTinyDisplayFont);
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()-siz.getWidth()-6), 30, 0, 2, ColorLocation.getColor(map), Color.BLACK, text);
statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
//stat_update_required = false;
@ -421,17 +618,25 @@ public class Profile {
if (gamemode!=-1) {
switch (gamemode) {
case 0:{ //Egg Hunt.
if (session.eggCount>0) {
spacing = width/session.eggCount;
rainbowEggLimit = session.eggCount;
if (session.rainbowEggGoal>0) {
spacing = width/session.rainbowEggGoal;
rainbowEggLimit = session.rainbowEggGoal;
} else {
spacing = width/5;
rainbowEggLimit = session.eggCount;
rainbowEggLimit = session.rainbowEggGoal;
}
Image img = RabiRaceModule.image_map.get("easter_egg.png");
for (int i=0;i<session.eggCount;i++) {
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
if (rainbowEggLimit>10) {
Color col = RabiRaceModule.rainbowcycler.getCycleColor();
Rectangle2D siz = TextUtils.calculateStringBoundsFont("x "+GetRainbowEggCount(this)+" / "+session.rainbowEggGoal, sigIRC.panel.rabiRibiMoneyDisplayFont);
DrawUtils.drawImage(g2, img, (int)(border+spacing*3-siz.getX()),(int)(36),col,sigIRC.panel);
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (border+spacing*3+img.getWidth(sigIRC.panel)*1.25), (36+img.getHeight(sigIRC.panel)/2),
1,Color.WHITE,Color.BLACK,"x "+GetRainbowEggCount(this)+" / "+session.rainbowEggGoal);
} else {
for (int i=0;i<session.rainbowEggGoal;i++) {
Color col = (GetRainbowEggCount(this)>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
}
}
}break;
case 1:{ //Item Hunt.
@ -504,17 +709,18 @@ public class Profile {
RabiRaceModule.image_map.get("pack_up.png"),
RabiRaceModule.image_map.get("attack_up.png")};
int[] amts = new int[]{
healthUps,
manaUps,
regenUps,
packUps,
attackUps,
GetHealthUpCount(this),
GetManaUpCount(this),
GetRegenUpCount(this),
GetPackUpCount(this),
GetAttackUpCount(this),
};
if (rainbowEggCount>rainbowEggLimit) {
spacing=width/6;
if (GetRainbowEggCount(this)>rainbowEggLimit) {
imgs = Arrays.copyOf(imgs, imgs.length+1);
imgs[imgs.length-1] = RabiRaceModule.image_map.get("easter_egg.png");
amts = Arrays.copyOf(amts, amts.length+1);
amts[amts.length-1] = rainbowEggCount;
amts[amts.length-1] = GetRainbowEggCount(this);
spacing = width/6;
}
//g2.drawImage(RabiRaceModule.image_map.get("bunny_strike.png"),(int)(+border+(i++)*(spacing)-img2.getWidth(sigIRC.panel)/4),(int)(+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
@ -525,7 +731,7 @@ public class Profile {
} else {
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, sigIRC.panel);
}
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size)+shiftyval, 0, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
}
} catch (ConcurrentModificationException e) {

@ -5,7 +5,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import sig.sigIRC;
import sig.modules.RabiRaceModule;
import sig.utils.FileUtils;
import sig.utils.ReflectUtils;
public class Session {
@ -15,9 +17,10 @@ public class Session {
int maxPlayers = 0;
String password = "";
float difficulty = -1;
boolean coop = false;
int gamemode = 0; //0 = Egg Mode, 1 = Item Hunt Mode
String[] itemHuntData;
int eggCount = 0;
int rainbowEggGoal = 0;
int id = 0;
List<Profile> players = new ArrayList<Profile>();
@ -40,29 +43,20 @@ public class Session {
if (playerlist.length>1) {
for (String s : playerlist) {
Profile p = new Profile(RabiRaceModule.module,true);
p.username=s;
p.displayName=p.username=s;
p.avatar = Profile.GetSeededAvatar(p.username);
//System.out.println("Player "+p.username);
if (p.downloadProfile()) {
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
RabiRaceModule.mySession = this;
}
//System.out.println("Adding Player "+p);
players.add(p);
}
DownloadAndAddPlayer(p);
}
} else {
Profile p = new Profile(RabiRaceModule.module,true);
p.username=val;
p.displayName=p.username=val;
p.avatar = Profile.GetSeededAvatar(p.username);
//System.out.println("Player "+p.username);
if (p.downloadProfile()) {
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
RabiRaceModule.mySession = this;
}
//System.out.println("Adding Player "+p);
players.add(p);
}
DownloadAndAddPlayer(p);
}
if (RabiRaceModule.syncItems) {
RabiRaceModule.module.SyncItemsWithOtherPlayers();
}
}
if (split.length>=8) {
@ -72,13 +66,30 @@ public class Session {
gamemode = Integer.parseInt(split[i++]);
switch (gamemode) {
case 0:{
eggCount = Integer.parseInt(split[i++]);
rainbowEggGoal = Integer.parseInt(split[i++]);
}break;
case 1:{
itemHuntData = split[i++].split(";");
}break;
}
}
if (split.length>=11) {
coop = Boolean.parseBoolean(split[i++]);
}
}
private void DownloadAndAddPlayer(Profile p) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]Download profile for "+p.username+".", "debug2.log");
if (p.downloadProfile()) {
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
RabiRaceModule.mySession = this;
//RetrieveClientAvatar(p);
}
//System.out.println("Adding Player "+p);
players.add(p);
} else {
FileUtils.logToFile("["+System.currentTimeMillis()+"]Failed to download profile for player "+p.username+"!", "debug2.log");
}
}
public int getID() {
@ -89,6 +100,10 @@ public class Session {
return players;
}
public boolean isCoop() {
return coop;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.getClass().getName()+"(");

@ -11,12 +11,14 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -54,12 +56,13 @@ public class SessionCreateWindow extends JFrame{
JPanel namepanel = new JPanel();
JPanel playerpanel = new JPanel();
JPanel passwordpanel = new JPanel();
JPanel cooppanel = new JPanel();
JPanel difficultypanel = new JPanel();
JPanel modepanel = new JPanel();
JPanel eggpropertiespanel = new JPanel();
JPanel[] panel_list = new JPanel[]{
namepanel,playerpanel,passwordpanel,difficultypanel,modepanel,eggpropertiespanel,itempropertiespanel
namepanel,playerpanel,passwordpanel,cooppanel,difficultypanel,modepanel,eggpropertiespanel,itempropertiespanel
};
for (JPanel panel : panel_list) {
@ -90,7 +93,17 @@ public class SessionCreateWindow extends JFrame{
playerpanel.add(passwordLabel);
playerpanel.add(pass);
JLabel difficultyLabel = new JLabel("Race Difficulty (0.00~10.00): ");
JLabel cooplabel = new JLabel("MultiBun (Coop) ");
JCheckBox coop = new JCheckBox();
coop.setPreferredSize(new Dimension(60,24));
coop.setSelected(false);
cooppanel.add(Box.createHorizontalStrut(60));
cooppanel.add(cooplabel);
cooppanel.add(coop);
cooppanel.add(Box.createHorizontalStrut(60));
JLabel difficultyLabel = new JLabel("Race Difficulty: ");
difficulty.setPreferredSize(new Dimension(60,24));
difficulty.setText("5.00");
@ -186,8 +199,8 @@ public class SessionCreateWindow extends JFrame{
JOptionPane.showMessageDialog(RabiRaceModule.createwindow, "Your egg count is invalid!", "Error!", JOptionPane.WARNING_MESSAGE);
return;
}
if (((String)gametype.getSelectedItem()).equalsIgnoreCase("Egg Mode") && (Integer.parseInt(eggcount.getText())>48 || Integer.parseInt(eggcount.getText())<2)) {
JOptionPane.showMessageDialog(RabiRaceModule.createwindow, "Your egg count needs to be between 2-48!", "Error!", JOptionPane.WARNING_MESSAGE);
if (((String)gametype.getSelectedItem()).equalsIgnoreCase("Egg Mode") && (Integer.parseInt(eggcount.getText())>80 || Integer.parseInt(eggcount.getText())<2)) {
JOptionPane.showMessageDialog(RabiRaceModule.createwindow, "Your egg count needs to be between 2-80!", "Error!", JOptionPane.WARNING_MESSAGE);
return;
}
if (!TextUtils.isNumeric(difficulty.getText()) && difficulty.getText().length()>0) {
@ -206,13 +219,14 @@ public class SessionCreateWindow extends JFrame{
sessionText = sessionText.replaceAll(" ", "%20");
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try {
//System.out.println("Write to "+"http://45.33.13.215/rabirace/send.php?key=sessioncreate&name="+sessionText+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")+"&difficulty="+((difficulty.getText().length()>0)?difficulty.getText():"-1")+"&mode="+GetModeIndex()+"&extradata="+GetModeData());
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=sessioncreate&name="+sessionText+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")+"&difficulty="+((difficulty.getText().length()>0)?difficulty.getText():"-1")+"&mode="+GetModeIndex()+"&extradata="+GetModeData()),file);
//org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=sessioncreate&name="+session_name.getText()+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")),file);
//System.out.println("Write to "+"http://45.33.13.215:8080/rabirace/send.php?key=sessioncreate&name="+sessionText+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")+"&difficulty="+((difficulty.getText().length()>0)?difficulty.getText():"-1")+"&mode="+GetModeIndex()+"&extradata="+GetModeData());
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=sessioncreate&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+RabiRaceModule.module.myProfile.username+"&roomname="+sessionText+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")+"&difficulty="+((difficulty.getText().length()>0)?difficulty.getText():"-1")+"&mode="+GetModeIndex()+"&extradata="+GetModeData()+"&coop="+GetCoopValue()),file);
//org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=sessioncreate&name="+session_name.getText()+"&players="+maxplayers.getText()+"&password="+((hashpass.length()>0)?hashpass:"none")),file);
String[] contents = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp.data");
int sessionID=-1;
if (contents.length>=2) {
sessionID=Integer.parseInt(contents[0]);
System.out.println(Arrays.toString(contents));
}
if (sessionID!=-1) {
RabiRaceModule.module.getSessionList();
@ -229,6 +243,10 @@ public class SessionCreateWindow extends JFrame{
}
}
private Boolean GetCoopValue() {
return coop.isSelected();
}
private String GetModeIndex() {
switch (((String)gametype.getSelectedItem())) {
case "Egg Mode":{
@ -276,13 +294,16 @@ public class SessionCreateWindow extends JFrame{
container.setLayout(new BoxLayout(container,BoxLayout.PAGE_AXIS));
container.add(Box.createRigidArea(new Dimension(24,24)));
container.add(namepanel);
/*(container.add(namepanel);
container.add(playerpanel);
container.add(passwordpanel);
container.add(difficultypanel);
container.add(modepanel);
container.add(eggpropertiespanel);
container.add(itempropertiespanel);
container.add(itempropertiespanel);*/
for (JPanel panel : panel_list) {
container.add(panel);
}
for (int i=0;i<10;i++) {
ItemDisplayBox<MemoryData> box = new ItemDisplayBox<MemoryData>(this);
box.myPanel.setVisible(false);
@ -293,9 +314,9 @@ public class SessionCreateWindow extends JFrame{
container.add(Box.createRigidArea(new Dimension(24,24)));
this.add(container);
this.setSize(400, 240);
this.setMinimumSize(new Dimension(400, 240));
this.setMaximumSize(new Dimension(400, 240));
this.setSize(400, 280);
this.setMinimumSize(new Dimension(400, 280));
this.setMaximumSize(new Dimension(400, 280));
this.setResizable(false);
}
@ -367,7 +388,7 @@ public class SessionCreateWindow extends JFrame{
return true;
}
int val = Integer.parseInt(getText());
if (val>48 || val<2) {
if (val>80 || val<2) {
return true;
}
return false;

@ -148,7 +148,7 @@ public class SessionListWindow extends JFrame{
hashedPass="none";
}
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=joinsession&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=joinsession&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file);
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
if (data.length==1) {
@ -208,6 +208,8 @@ public class SessionListWindow extends JFrame{
}
count++;
}
FileUtils.logToFile("["+System.currentTimeMillis()+"]Updated sessions listing.", "debug.log");
//System.out.println("Selected is "+selected);
//Try to find ID in list.
}

@ -5,6 +5,7 @@ import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
@ -37,6 +38,7 @@ import sig.modules.RabiRace.ClickableButton;
import sig.modules.RabiRace.ColorCycler;
import sig.modules.RabiRace.CreateButton;
import sig.modules.RabiRace.JoinButton;
import sig.modules.RabiRace.MarkMapButton;
import sig.modules.RabiRace.MemoryData;
import sig.modules.RabiRace.Profile;
import sig.modules.RabiRace.Session;
@ -48,34 +50,62 @@ import sig.modules.RabiRibi.MemoryType;
import sig.modules.utils.PsapiTools;
import sig.utils.DrawUtils;
import sig.utils.FileUtils;
import sig.utils.SoundUtils;
import sig.utils.TextUtils;
public class RabiRaceModule extends Module{
final static int ERINA = 0;
final static int RIBBON = 1;
final static int CICINI = 2;
final static int MIRIAM = 3;
public final static int DEBUGMODE = 0;
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
final static String AVATAR_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/characters/";
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ;
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ | WinNT.PROCESS_VM_WRITE;
boolean foundRabiRibi = false;
final static int WAITFRAMEMAX = 120;
int waitframes = WAITFRAMEMAX;
int rabiRibiPID = -1;
long rabiRibiMemOffset = 0;
public HANDLE rabiribiProcess = null;
public static HashMap<String,Image> image_map = new HashMap<String,Image>();
public static Image UNKNOWN_ITEM;
public static ColorCycler rainbowcycler = new ColorCycler(new Color(255,0,0,96),16);
public Profile myProfile = new Profile(this,false);
public static RabiRaceModule module;
public Profile myProfile = new Profile(this,false);
public static SessionListWindow window;
public static SessionCreateWindow createwindow;
public static AvatarSelectionWindow avatarwindow;
public static Session mySession;
boolean firstCheck=false;
public List<ScrollingText> messages = new ArrayList<ScrollingText>();
public List<String> messagequeue = new ArrayList<String>();
public static int lastScrollX = 0;
boolean firstUpdate=true;
boolean mouseoverAvatar=false;
public static boolean avatarRetrieved=false;
public static int CLIENT_SERVER_READTIME = -1;
public static boolean syncItems = false;
public static int selectedMapIcon = 13;
public static int lastreadmapdata = 0;
public boolean viewingupdatedMapIcons=false;
public HashMap<Integer,Integer> mapdata = new HashMap<Integer,Integer>();
public HashMap<Integer,Integer> newmapdata = new HashMap<Integer,Integer>();
public static ScheduledExecutorService scheduler,scheduler2;
public static boolean syncEvents = true;
//public static boolean darknessHasReachedzero = true; //darkness needs to go down to 0, then go back up.
public static boolean hasDied = false;
public static String lastEventString = "";
int frames=0;
public static final int[] RESTRICTED_EVENTS = new int[] {256,257,260,262,264,265,266,267,268,269,271,272,278,279,284,289,290,295,296,307,315,316,322,323,324,331,333,344,345,371,377,379,385,386,387,399,412,427,428,451,452,464,465,484,516,517,518,519};
public static final int[] BOSSSONGS = new int[] {8,27,33,34,36,37,38,39,42,43,44,47,48,51,52,54,56,59,60,61,63,64};
public SessionListData session_listing = new SessionListData();
ClickableButton join_button,create_button;
ClickableButton join_button,create_button,markmap_button;
public Image mapiconimg;
public static List<MemoryData> key_items_list = new ArrayList<MemoryData>();
public static List<MemoryData> badges_list = new ArrayList<MemoryData>();
@ -95,37 +125,27 @@ public class RabiRaceModule extends Module{
}
private void Initialize() {
File f = new File("debug.log");
f.delete();
f = new File("debug2.log");
f.delete();
CheckRabiRibiClient();
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
VerifyClientIsValid(); //If the client is not allowed to send data, we need to know that.
scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleWithFixedDelay(()->{
CheckRabiRibiClient();
if (foundRabiRibi) {
myProfile.uploadProfile();
getSessionList();
getMessageUpdates();
//trimeadProfile.downloadProfile();
firstCheck=true;
if (mySession!=null) {
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=keepalivesession&session="+mySession.getID()),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}, 5000, 5000, TimeUnit.MILLISECONDS);
RunRabiRace();
}, 1500, 1500, TimeUnit.MILLISECONDS);
myProfile.downloadProfile(); //Synchronize our profile at the beginning.
//System.out.println(myProfile.avatar.displayName);
ScheduledExecutorService scheduler2 = Executors.newScheduledThreadPool(1);
scheduler2 = Executors.newScheduledThreadPool(1);
scheduler2.scheduleWithFixedDelay(()->{
if (foundRabiRibi) {
UpdateMyProfile();
}
RunRabiRaceUpdater();
}, 250, 250, TimeUnit.MILLISECONDS);
File dir = new File(ITEMS_DIRECTORY);
@ -158,6 +178,7 @@ public class RabiRaceModule extends Module{
try {
UNKNOWN_ITEM = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/rabi-ribi/unknown.png"));
mapiconimg = ImageIO.read(new File(sigIRC.BASEDIR+"map_icons.png"));
} catch (IOException e) {
e.printStackTrace();
}
@ -166,6 +187,75 @@ public class RabiRaceModule extends Module{
join_button = new JoinButton(new Rectangle(2,(int)(position.getHeight()-18),120,18),"Join Session (0)",this);
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-18),120,18),"Create Session",this);
markmap_button = new MarkMapButton(new Rectangle(2,(int)(position.getHeight()-42),120,18),"Mark Map",this);
}
public static void loadModule() {
sigIRC.modules.add(new RabiRaceModule(
new Rectangle(sigIRC.rabiracemodule_X,sigIRC.rabiracemodule_Y,sigIRC.rabiracemodule_width,sigIRC.rabiracemodule_height),
"Rabi Race"
));
sigIRC.rabiracemodule_enabled=true;
sigIRC.config.setBoolean("Module_rabirace_Enabled", sigIRC.rabiracemodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof RabiRaceModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.rabiracemodule_enabled=false;
sigIRC.config.setBoolean("Module_rabirace_Enabled", sigIRC.rabiracemodule_enabled);
sigIRC.config.saveProperties();
}
private void RunRabiRaceUpdater() {
if (foundRabiRibi) {
UpdateMyProfile();
}
}
private void RunRabiRace() {
CheckRabiRibiClient();
if (foundRabiRibi) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]Start update cycle...", "debug.log");
myProfile.uploadProfile();
getSessionList();
getMessageUpdates();
//trimeadProfile.downloadProfile();
firstCheck=true;
if (mySession!=null) {
RequestData("tmp.data","key=keepalivesession&session="+mySession.getID());
FileUtils.logToFile("["+System.currentTimeMillis()+"]Requested data"+"key=keepalivesession&session="+mySession.getID(), "debug.log");
}
}
}
private void VerifyClientIsValid() {
String[] data = RequestAndStoreData("tmptimer.dat","key=timestamp");
int time = -1;
if (data.length>0) {
time = Integer.parseInt(data[0]);
}
CLIENT_SERVER_READTIME = time;
}
private void RequestData(String filename,String requestString) {
File file = new File(sigIRC.BASEDIR+"sigIRC/"+filename);
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?"+requestString),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
String[] RequestAndStoreData(String filename,String requestString) {
RequestData(filename,requestString);
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/"+filename);
return data;
}
private void AddImagesToImageMap(File dir, String DIRECTORY) {
@ -191,24 +281,206 @@ public class RabiRaceModule extends Module{
private void getMessageUpdates() {
File file = new File(sigIRC.BASEDIR+"sigIRC/messages");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=getupdates&name="+myProfile.username),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=getupdates&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+myProfile.username),file);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/messages");
FileUtils.logToFile("["+System.currentTimeMillis()+"]Message updates."+"http://45.33.13.215:8080/rabirace/send.php?key=getupdates&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&name="+myProfile.username+" Data: "+Arrays.deepToString(data), "debug.log");
//boolean message_played=false;
for (String s : data) {
if (s.length()>0) {
messages.add(new ScrollingText(s,(int)(lastScrollX+position.getWidth()+24),(int)(position.getHeight()-28)));
/*message_played=true;
System.out.println("Perform item sync with other players.");
SyncItemsWithOtherPlayers();*/
messagequeue.add(s);
if (mySession!=null && mySession.isCoop()) {
syncItems=true;
}
FileUtils.logToFile("Add "+s+" to message queue.", "debug.log");
}
}
if (mySession!=null) {
File file2 = new File(sigIRC.BASEDIR+"mapdata");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/maps/"+mySession.getID()),file2);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
int MapUpdatesRequired=0;
String byWhom = "";
String[] mapdata = FileUtils.readFromFile(sigIRC.BASEDIR+"mapdata");
for (int i=lastreadmapdata+1;i<mapdata.length;i++) {
String[] s = mapdata[i].split(";");
if (s.length>=2) {
if (!s[0].equalsIgnoreCase(myProfile.username)) {
if (!this.newmapdata.containsKey(Integer.parseInt(s[1]))) {
MapUpdatesRequired++;
byWhom = s[0];
this.newmapdata.put(Integer.parseInt(s[1]),Integer.parseInt(s[2]));
}
}
this.mapdata.put(Integer.parseInt(s[1]),Integer.parseInt(s[2]));
int id = Integer.parseInt(s[1]);
AddMapPoint((int)Math.floor(id/450),(int)Math.floor(id%450/18),id%450%18,Integer.parseInt(s[2]),false);
lastreadmapdata=Math.max(i,lastreadmapdata);
}
}
FileUtils.logToFile("["+System.currentTimeMillis()+"]MapUpdates:"+MapUpdatesRequired+" - "+byWhom, "debug.log");
if (MapUpdatesRequired>0) {
if (MapUpdatesRequired==1) {
messagequeue.add(byWhom+" has added a new marker to the map!");
} else {
messagequeue.add(MapUpdatesRequired+" new markers have been added to the map!");
}
}
}
/*if (message_played && mySession.isCoop()) {
SoundUtils.playSound(sigIRC.BASEDIR+"sigIRC/collect_item.wav");
}*/
}
public void AddMapPoint(int area, int x, int y, int color, boolean update) {
int id = y+18*x+area*450;
writeIntToMemory(MemoryOffset.MAP_REGION_START.getOffset()+
id*4,color);
if (mySession!=null && mySession.isCoop() && update) {
mapdata.put(id,color);
File file2 = new File(sigIRC.BASEDIR+"tmp_mapdata");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?session="+mySession.getID()+"&key=addmappoint&timekey="+RabiRaceModule.CLIENT_SERVER_READTIME+"&mappoint="+myProfile.username+";"+id+";"+color),file2);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void SyncItemsWithOtherPlayers() {
boolean soundPlayed=false;
if (mySession!=null && mySession.isCoop()) {
for (Profile p : mySession.getPlayers()) {
if (p!=myProfile && !p.isPaused && !myProfile.isPaused && p.username!=myProfile.username) {
boolean updateRequired=false;
for (MemoryData m : p.key_items.keySet()) {
if (p.key_items.get(m)!=0 && (!myProfile.key_items.containsKey(m) || myProfile.key_items.get(m)==0)) {
System.out.println("You do not have a "+m.name+". Syncing from "+p.displayName+".");
if (!(readIntFromMemory(MemoryOffset.BOSS_FIGHT.getOffset())==1 && m==MemoryData.RIBBON)) {
writeIntToMemory(m.mem.getOffset(),Math.abs(p.key_items.get(m)));
updateRequired=true;
}
}
}
for (MemoryData m : p.badges.keySet()) {
if (p.badges.get(m)!=0 && (!myProfile.badges.containsKey(m) || myProfile.badges.get(m)==0)) {
System.out.println("You do not have a "+m.name+". Syncing from "+p.displayName+".");
writeIntToMemory(m.mem.getOffset(),Math.abs(p.badges.get(m)));
updateRequired=true;
}
}
if (Profile.GetHealthUpCount(p)>Profile.GetHealthUpCount(myProfile)) {
System.out.println("You do not have the correct amount of health ups. Syncing to ("+p.healthUps+") from "+p.displayName+".");
UpdateRange_WithoutParsing(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END,p.healthUps);
updateRequired=true;
}
if (Profile.GetManaUpCount(p)>Profile.GetManaUpCount(myProfile)) {
System.out.println("You do not have the correct amount of mana ups. Syncing to ("+p.manaUps+") from "+p.displayName+".");
UpdateRange_WithoutParsing(MemoryOffset.MANAUP_START,MemoryOffset.MANAUP_END,p.manaUps);
updateRequired=true;
}
if (Profile.GetRegenUpCount(p)>Profile.GetRegenUpCount(myProfile)) {
System.out.println("You do not have the correct amount of regen ups. Syncing to ("+p.regenUps+") from "+p.displayName+".");
UpdateRange_WithoutParsing(MemoryOffset.REGENUP_START,MemoryOffset.REGENUP_END,p.regenUps);
updateRequired=true;
}
if (Profile.GetPackUpCount(p)>Profile.GetPackUpCount(myProfile)) {
System.out.println("You do not have the correct amount of pack ups. Syncing to ("+p.packUps+") from "+p.displayName+".");
UpdateRange_WithoutParsing(MemoryOffset.PACKUP_START,MemoryOffset.PACKUP_END,p.packUps);
updateRequired=true;
}
if (Profile.GetAttackUpCount(p)>Profile.GetAttackUpCount(myProfile)) {
System.out.println("You do not have the correct amount of attack ups. Syncing to ("+p.attackUps+") from "+p.displayName+".");
UpdateRange_WithoutParsing(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END,p.attackUps);
updateRequired=true;
}
if (!p.eventStruct.equalsIgnoreCase(myProfile.eventStruct)) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]Events are not synced with "+p.displayName, "debug.log");
StringBuilder finalevents = new StringBuilder();
String[] events = p.eventStruct.split("_");
FileUtils.logToFile("["+System.currentTimeMillis()+"]"+p.displayName+"'s events: "+Arrays.toString(events), "debug.log");
String[] myevents = myProfile.eventStruct.split("_");
FileUtils.logToFile("["+System.currentTimeMillis()+"]"+myProfile.displayName+"'s events: "+Arrays.toString(myevents), "debug.log");
for (int i=0;i<Profile.EVENT_COUNT;i++) {
if (i!=1 && i!=90 && i!=190 && i!=177) { //Ignore syncing ribbon event, irisu library event, and forgotten cave 2 event.
finalevents.append((events[i].compareTo(Integer.toString(readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4)))>0)?events[i]:readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4));
/*if (events[i].compareTo(Integer.toString(readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4)))>0) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]Updated event "+i+" to value "+events[i], "debug.log");
}*/
//finalevents.append((Integer.compare(myProfile.eventStruct.charAt(i),p.eventStruct.charAt(i))<0)?p.eventStruct.charAt(i):myProfile.eventStruct.charAt(i));
} else {
finalevents.append(readIntFromMemory(MemoryOffset.EVENT_START.getOffset()+i*4));
}
finalevents.append("_");
}
UpdateRange(MemoryOffset.EVENT_START,MemoryOffset.EVENT_END,finalevents.toString());
FileUtils.logToFile("["+System.currentTimeMillis()+"]ll event ranges updated.", "debug.log");
}
if (updateRequired && mySession.isCoop()) {
if (!soundPlayed) {
SoundUtils.playSound(sigIRC.BASEDIR+"sigIRC/collect_item.wav");
soundPlayed=true;
}
updateRequired=false;
}
}
}
}
}
private void UpdateRange_WithoutParsing(MemoryOffset start, MemoryOffset end, String i) {
/*int f=63;
while (i>0 && f>0) {
if (readIntFromMemory(start.getOffset())==0) {
writeIntToMemory(start.getOffset()+(f*4),1);
i--;
}
f--;
}*/
for (int l=0;l<i.length();l++) {
writeIntToMemory(start.getOffset()+(l*4),Integer.parseInt(Character.toString(i.charAt(l))));
}
}
private void UpdateRange(MemoryOffset start, MemoryOffset end, String i) {
/*int f=63;
while (i>0 && f>0) {
if (readIntFromMemory(start.getOffset())==0) {
writeIntToMemory(start.getOffset()+(f*4),1);
i--;
}
f--;
}*/
String[] split = i.split("_");
FileUtils.logToFile("["+System.currentTimeMillis()+"]Parsed events: "+Arrays.deepToString(split)+".", "debug.log");
for (int l=0;l<split.length;l++) {
writeIntToMemory(start.getOffset()+(l*4),Integer.parseInt(split[l]));
}
}
public void getSessionList() {
File file = new File(sigIRC.BASEDIR+"sessions");
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=getsessions"),file);
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215:8080/rabirace/send.php?key=getsessions"),file);
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sessions");
//System.out.println("Data is "+Arrays.toString(data));
session_listing.UpdateData(data);
@ -220,6 +492,7 @@ public class RabiRaceModule extends Module{
} else {
join_button.setButtonLabel("Leave Session");
}
FileUtils.logToFile("["+System.currentTimeMillis()+"]Retrieve session list."+"http://45.33.13.215:8080/rabirace/send.php?key=getsessions", "debug.log");
window.UpdateSessionList();
}
@ -230,11 +503,19 @@ public class RabiRaceModule extends Module{
if (firstCheck && mySession==null && create_button.mouseInsideBounds(ev)) {
create_button.onClickEvent(ev);
}
if (firstCheck && markmap_button.mouseInsideBounds(ev)) {
markmap_button.onClickEvent(ev);
}
if (mouseoverAvatar) {
avatarwindow.setVisible(true);
}
}
public void mouseWheel(MouseWheelEvent ev) {
selectedMapIcon+=Math.signum(ev.getWheelRotation());
selectedMapIcon=(selectedMapIcon<0)?15:selectedMapIcon%16;
}
private void CheckRabiRibiClient() {
List<Integer> pids;
try {
@ -280,8 +561,25 @@ public class RabiRaceModule extends Module{
}
public void run() {
frames++;
if (foundRabiRibi) {
if (scheduler.isTerminated() || scheduler.isShutdown()) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]For some reason scheduler was terminated! Trying to restart...", "debug2.log");
scheduler.scheduleWithFixedDelay(()->{
RunRabiRace();
}, 1500, 1500, TimeUnit.MILLISECONDS);
}
if (scheduler2.isTerminated() || scheduler2.isShutdown()) {
FileUtils.logToFile("["+System.currentTimeMillis()+"]For some reason scheduler2 was terminated! Trying to restart...", "debug2.log");
scheduler2.scheduleWithFixedDelay(()->{
RunRabiRaceUpdater();
}, 250, 250, TimeUnit.MILLISECONDS);
}
rainbowcycler.run();
/*System.out.println("Value: ("+Integer.toHexString((int)(rabiRibiMemOffset+0x1679EF0))+"): "+readIntFromMemory(0x1679EF0));
System.out.println("Write...");
writeIntToMemory(0x1679EF0,0);
System.out.println("Value: ("+Integer.toHexString((int)(rabiRibiMemOffset+0x1679EF0))+"): "+readIntFromMemory(0x1679EF0));*/
if (window!=null) {
window.run();
}
@ -290,22 +588,85 @@ public class RabiRaceModule extends Module{
messages.remove(i--);
}
}
if (messagequeue.size()>0) {
if (NoMessageDisplayed()) {
int character=0;
character = messagequeue.get(0).contains("to the map!")?RabiRaceModule.MIRIAM:messagequeue.get(0).contains("Rainbow Egg")?RabiRaceModule.CICINI:messagequeue.get(0).contains(myProfile.displayName)?RabiRaceModule.ERINA:RabiRaceModule.RIBBON;
DisplayMessage(messagequeue.get(0).length()>255?messagequeue.remove(0).substring(0,255):messagequeue.remove(0),8,character);
}
}
if (lastScrollX>0) {
lastScrollX-=ScrollingText.SCROLLSPD;
}
}
}
public void DisplayMessage(String s, int seconds, int character) {
writeIntToMemory(MemoryOffset.MESSAGE_CHARACTER.getOffset(),character);
writeStringToMemory(MemoryOffset.MESSAGE_TEXT.getOffset(),s,256);
writeIntToMemory(MemoryOffset.MESSAGE_TEXTREF.getOffset(),27);
}
private boolean NoMessageDisplayed() {
return readIntFromMemory(MemoryOffset.MESSAGE_TIMER)==0;
}
public boolean OnTitleScreen() {
/*return readIntFromMemory(MemoryOffset.INTERFACE_GRAPHICS_CONTROLLER)==809054496 ||
readIntFromMemory(MemoryOffset.INTERFACE_GRAPHICS_CONTROLLER)==1593843744 ||
readIntFromMemory(MemoryOffset.INTERFACE_GRAPHICS_CONTROLLER)==842018353 ||
readIntFromMemory(MemoryOffset.INTERFACE_GRAPHICS_CONTROLLER)==706755104;*/
return readIntFromMemory(MemoryOffset.TITLE_SCREEN)==0;
}
private void UpdateMyProfile() {
if (foundRabiRibi) {
//System.out.println("Called.");
int paused = readIntFromMemory(MemoryOffset.PAUSED);
int paused = readIntFromMemory(MemoryOffset.PAUSED) + (OnTitleScreen()?1:0);
//int paused = 0; //TODO FORCE UNPAUSE FOR NOW.
float itempct = readFloatFromMemory(MemoryOffset.ITEM_PERCENT);
myProfile.isPaused = paused==1;
myProfile.isPaused = paused>=1;
if (mySession!=null && mySession.isCoop()) {
if (OnTitleScreen()) {
if (waitframes--<=0) {
mapdata.clear();
newmapdata.clear();
lastreadmapdata=0;
}
} else {
waitframes = WAITFRAMEMAX;
}
if (newmapdata.size()>0 && readIntFromMemory(MemoryOffset.PAUSED)>0) {
viewingupdatedMapIcons=true;
for (Integer i : newmapdata.keySet()) {
int icon = mapdata.get(i);
if ((frames%40)>=20) {
AddMapPoint((int)Math.floor(i/450),(int)Math.floor(i%450/18),i%450%18,6,false);
} else {
AddMapPoint((int)Math.floor(i/450),(int)Math.floor(i%450/18),i%450%18,icon,false);
}
}
}
if (viewingupdatedMapIcons && readIntFromMemory(MemoryOffset.PAUSED)==0) {
viewingupdatedMapIcons=false;
for (Integer i : newmapdata.keySet()) {
int icon = mapdata.get(i);
AddMapPoint((int)Math.floor(i/450),(int)Math.floor(i%450/18),i%450%18,icon,false);
}
newmapdata.clear();
}
}
//System.out.println(itempct+","+paused);
if (paused==0 && itempct>=0) {
myProfile.archiveAllValues();
myProfile.rainbowEggCount = readIntFromMemory(MemoryOffset.RAINBOW_EGG_COUNT);
myProfile.rainbowEggs = readIntFromMemory(MemoryOffset.RAINBOW_EGG_COUNT);
myProfile.attackUps = readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END);
myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END);
myProfile.manaUps = readItemCountFromMemory(MemoryOffset.MANAUP_START,MemoryOffset.MANAUP_END);
@ -313,9 +674,9 @@ public class RabiRaceModule extends Module{
myProfile.packUps = readItemCountFromMemory(MemoryOffset.PACKUP_START,MemoryOffset.PACKUP_END);
myProfile.itempct = itempct;
myProfile.mappct = readFloatFromMemory(MemoryOffset.MAP_PERCENT);
myProfile.playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
myProfile.difficulty = readIntFromMemory(MemoryOffset.GAME_DIFFICULTY);
myProfile.loop = readIntFromMemory(MemoryOffset.GAME_LOOP);
myProfile.map = readIntFromMemory(MemoryOffset.MAP_AREA_COLOR);
myProfile.updateClientValues();
if (mySession!=null && !firstUpdate) {
myProfile.compareAndAnnounceAllChangedValues();
@ -326,6 +687,7 @@ public class RabiRaceModule extends Module{
myProfile.stat_update_required=true;
firstUpdate=false;
}
myProfile.playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
if (mySession!=null) {
for (Profile p : mySession.getPlayers()) {
if (!p.username.equalsIgnoreCase(myProfile.username)) {
@ -365,6 +727,36 @@ public class RabiRaceModule extends Module{
return mem.getFloat(0);
}
public void writeIntToMemory(long offset,int value) {
//Pointer valueptr = new Pointer();
Memory valueptr = new Memory(8);
valueptr.setInt(0, value);
//new Pointer(rabiRibiMemOffset+offset).setMemory((long)0, (long)4, (byte)value);
Kernel32.INSTANCE.WriteProcessMemory(rabiribiProcess,
new Pointer(rabiRibiMemOffset+offset),valueptr,4,null);
//Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
//return mem.getInt(0);
}
public void writeStringToMemory(long offset,String value, int size) {
//Pointer valueptr = new Pointer();
Memory valueptr = new Memory(size);
valueptr.setString(0, value);
//new Pointer(rabiRibiMemOffset+offset).setMemory((long)0, (long)4, (byte)value);
Kernel32.INSTANCE.WriteProcessMemory(rabiribiProcess,
new Pointer(rabiRibiMemOffset+offset),valueptr,size,null);
//Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
//return mem.getInt(0);
}
public void writeFloatToMemory(long offset,float value) {
Memory mem = new Memory(4);
//Pointer valueptr = new Pointer();
new Pointer(rabiRibiMemOffset+offset).setMemory((long)0, (long)4, (byte)value);
//Kernel32.INSTANCE.WriteProcessMemory(rabiribiProcess, , value,4,null);
//Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
//return mem.getInt(0);
}
public float readFloatFromMemoryOffset(MemoryOffset val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer+val.getOffset()), mem, 4, null);
@ -423,15 +815,13 @@ public class RabiRaceModule extends Module{
}
}
int readItemCountFromMemory(MemoryOffset start_range,
String readItemCountFromMemory(MemoryOffset start_range,
MemoryOffset end_range) {
int count=0;
for (long i=start_range.getOffset();i<=end_range.getOffset();i++) {
if (readIntFromMemory(i)==1) {
count++;
}
StringBuilder sb = new StringBuilder();
for (long i=start_range.getOffset();i<=end_range.getOffset();i+=4) {
sb.append(readIntFromMemory(i));
}
return count;
return sb.toString();
}
public void draw(Graphics g) {
@ -478,11 +868,15 @@ public class RabiRaceModule extends Module{
create_button.draw(g);
}
}
g.setColor(Color.BLACK);
if (mySession!=null) {
markmap_button.draw(g);
g.drawImage(mapiconimg, (int)(position.getX()+128), (int)(position.getY()+position.getHeight()-48), (int)(position.getX()+128+29), (int)(position.getY()+position.getHeight()-48)+29, selectedMapIcon*29, 0, selectedMapIcon*29+29, 29, sigIRC.panel);
}
/*g.setColor(Color.BLACK);
g.fillRect((int)(position.getX()), (int)(position.getY()+position.getHeight()-28-20), (int)(position.getWidth()), 20);
for (int i=0;i<messages.size();i++) {
messages.get(i).draw(g);
}
}*/
}
}
@ -515,4 +909,14 @@ public class RabiRaceModule extends Module{
}
}
}
public void MarkCurrentPosition() {
AddMapPoint(readIntFromMemory(MemoryOffset.MAP_AREA_NUMBER),
readIntFromMemory(MemoryOffset.MAP_TILE_X),
readIntFromMemory(MemoryOffset.MAP_TILE_Y),
selectedMapIcon+1,true);
/*for (int i=0;i<17;i++) {
AddMapPoint(0,i,0,i);
}*/
}
}

@ -1,19 +1,9 @@
package sig.modules.RabiRibi;
public enum MemoryOffset {
MONEY(0xD654CC,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
PLAYTIME(0xD642D8,0x12D97A8+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DB050+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881), //In frames (Rabi-Ribi runs at 60FPS).
MONEY(0x167C10C,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12FE9B4,0x167908C,0),
PLAYTIME(0x167C7B0,0x12D97A8+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DB050+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12DB040+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1679734,0), //In frames (Rabi-Ribi runs at 60FPS). Uses Total Playtime.
//UNKNOWN1(0xD65BDC), //???? Originally assumed to be "Health Ups".
HEALTHUP_START(0xD6342C,0xD6342C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
HEALTHUP_END(0xD63528,0xD63528+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
ATTACKUP_START(0xD6352C,0xD6352C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
ATTACKUP_END(0xD63628,0xD63628+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
MANAUP_START(0xD6362C,0xD6362C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
MANAUP_END(0xD63728,0xD63728+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
REGENUP_START(0xD6372C,0xD6372C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
REGENUP_END(0xD63828,0xD63828+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
PACKUP_START(0xD6382C,0xD6382C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
PACKUP_END(0xD63928,0xD63928+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
/*ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer.
ERINA_HP(0x4D8),
ERINA_MAXHP(0x4E8),
@ -38,132 +28,174 @@ public enum MemoryOffset {
GAME_DIFFICULTY(0xD64338,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D9818+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
GAME_LOOP(0xD6D05C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12E253C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
HAMMER(0xD632B0,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
AIR_JUMP(0xD632B4,0xD632B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
SLIDING_POWDER(0xD632B8,0xD632B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
CARROT_BOMB(0xD632BC,0xD632BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
HOURGLASS(0xD632C0,0xD632C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
SPEED_BOOST(0xD632C4,0xD632C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
AUTO_EARRINGS(0xD632C8,0xD632C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
RIBBON(0xD632CC,0xD632CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
SOUL_HEART(0xD632D0,0xD632D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
RABI_SLIPPERS(0xD632D4,0xD632D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BUNNY_WHIRL(0xD632D8,0xD632D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
QUICK_BARETTE(0xD632DC,0xD632DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BOOK_OF_CARROT(0xD632E0,0xD632E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
CHAOS_ROD(0xD632E4,0xD632E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
HAMMER_WAVE(0xD632E8,0xD632E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
HAMMER_ROLL(0xD632EC,0xD632EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
LIGHT_ORB(0xD632F0,0xD632F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
P_HAIRPIN(0xD63300,0x12D87D0+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V185_TO_V1881),
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
HEALING_STAFF(0xD63310,0xD63310+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
MAX_BRACELET(0xD63314,0xD63314+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
EXPLODE_SHOT(0xD63318,0xD63318+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
AIR_DASH(0xD6331C,0xD6331C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BUNNY_STRIKE(0xD63320,0xD63320+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
STRANGE_BOX(0xD63324,0xD63324+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
WALL_JUMP(0xD63328,0xD63328+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
SPIKE_BARRIER(0xD6332C,0xD6332C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BUNNY_AMULET(0xD63330,0xD63330+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
CHARGE_RING(0xD63334,0xD63334+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
CARROT_SHOOTER(0xD63338,0xD63338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
SUPER_CARROT(0xD6333C,0xD6333C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
RUMI_DONUT(0xD63340,0xD63340+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
RUMI_CAKE(0xD63344,0xD63344+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
GOLD_CARROT(0xD63348,0xD63348+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
COCOA_BOMB(0xD6334C,0xD6334C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM1(0xD63350,0xD63350+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
TROPHY(0xD63354,0xD63354+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
EXCLAMATION_POINT(0xD63358,0xD63358+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM2(0xD6335C,0xD6335C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM3(0xD63360,0xD63360+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM4(0xD63364,0xD63364+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
RAINBOW_MAGIC(0xD63368,0xD63368+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM5(0xD6336C,0xD6336C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM6(0xD63370,0xD63370+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM7(0xD63374,0xD63374+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM8(0xD63378,0xD63378+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM9(0xD6337C,0xD6337C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM10(0xD63380,0xD63380+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM11(0xD63384,0xD63384+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM12(0xD63388,0xD63388+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM13(0xD6338C,0xD6338C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
GAME_DIFFICULTY(0x167AF78,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D9818+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D9808+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1677EF8,0), //0=Casual, 5=BEX. See DifficultyStruct.java for more.
GAME_LOOP(0x1683C9C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12E253C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12E252C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1680C1C,0),
HAMMER(0xD632B0,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
AIR_JUMP(0xD632B4,0xD632B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SLIDING_POWDER(0xD632B8,0xD632B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
CARROT_BOMB(0xD632BC,0xD632BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HOURGLASS(0xD632C0,0xD632C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SPEED_BOOST(0xD632C4,0xD632C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
AUTO_EARRINGS(0xD632C8,0xD632C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
RIBBON(0xD632CC,0xD632CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SOUL_HEART(0xD632D0,0xD632D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
RABI_SLIPPERS(0xD632D4,0xD632D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BUNNY_WHIRL(0xD632D8,0xD632D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
QUICK_BARETTE(0xD632DC,0xD632DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BOOK_OF_CARROT(0xD632E0,0xD632E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
CHAOS_ROD(0xD632E4,0xD632E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HAMMER_WAVE(0xD632E8,0xD632E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HAMMER_ROLL(0xD632EC,0xD632EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
LIGHT_ORB(0xD632F0,0xD632F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
P_HAIRPIN(0xD63300,0x12D87D0+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V185_TO_V1881,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HEALING_STAFF(0xD63310,0xD63310+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
MAX_BRACELET(0xD63314,0xD63314+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
EXPLODE_SHOT(0xD63318,0xD63318+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
AIR_DASH(0xD6331C,0xD6331C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BUNNY_STRIKE(0xD63320,0xD63320+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
STRANGE_BOX(0xD63324,0xD63324+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
WALL_JUMP(0xD63328,0xD63328+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SPIKE_BARRIER(0xD6332C,0xD6332C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BUNNY_AMULET(0xD63330,0xD63330+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
CHARGE_RING(0xD63334,0xD63334+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
CARROT_SHOOTER(0xD63338,0xD63338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
SUPER_CARROT(0xD6333C,0xD6333C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
RUMI_DONUT(0xD63340,0xD63340+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
RUMI_CAKE(0xD63344,0xD63344+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
GOLD_CARROT(0xD63348,0xD63348+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
COCOA_BOMB(0xD6334C,0xD6334C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM1(0xD63350,0xD63350+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
TROPHY(0xD63354,0xD63354+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
EXCLAMATION_POINT(0xD63358,0xD63358+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM2(0xD6335C,0xD6335C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM3(0xD63360,0xD63360+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM4(0xD63364,0xD63364+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
RAINBOW_MAGIC(0xD63368,0xD63368+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM5(0xD6336C,0xD6336C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM6(0xD63370,0xD63370+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM7(0xD63374,0xD63374+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM8(0xD63378,0xD63378+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM9(0xD6337C,0xD6337C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM10(0xD63380,0xD63380+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM11(0xD63384,0xD63384+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM12(0xD63388,0xD63388+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM13(0xD6338C,0xD6338C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
/*DLC_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851),
DLC_ITEM2(0xD63398,0xD63398+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851),*/
BUNNY_CLOVER(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D887C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
FAIRYS_FLUTE(0,0x12D8874+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D8884+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
BUNNY_MEMORIES(0,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
WIND_BLESSING(0,0x12D7870,0x12D8880+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_MANA_PLUS(0xD633B4,0xD633B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_MANA_SURGE(0xD633B8,0xD633B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_CRISIS_BOOST(0xD633BC,0xD633BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_ATK_GROW(0xD633C0,0xD633C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_DEF_GROW(0xD633C4,0xD633C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_ATK_TRADE(0xD633C8,0xD633C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_DEF_TRADE(0xD633CC,0xD633CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_ARM_STRENGTH(0xD633D0,0xD633D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_CARROT_BOOST(0xD633D4,0xD633D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_WEAKEN(0xD633D8,0xD633D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_SELF_DEFENSE(0xD633DC,0xD633DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_ARMORED(0xD633E0,0xD633E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_LUCKY_SEVEN(0xD633E4,0xD633E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_HEX_CANCEL(0xD633E8,0xD633E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_PURE_LOVE(0xD633EC,0xD633EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_TOXIC_STRIKE(0xD633F0,0xD633F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_FRAME_CANCEL(0xD633F4,0xD633F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_HEALTH_WAGER(0xD633F8,0xD633F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_MANA_WAGER(0xD633FC,0xD633FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_STAMINA_PLUS(0xD63400,0xD63400+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_BLESSED(0xD63404,0xD63404+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_HITBOX_DOWN(0xD63408,0xD63408+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_CASHBACK(0xD6340C,0xD6340C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_SURVIVAL(0xD63410,0xD63410+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_TOP_FORM(0xD63414,0xD63414+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_TOUGH_SKIN(0xD63418,0xD63418+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_ERINA_BADGE(0xD6341C,0xD6341C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_RIBBON_BADGE(0xD63420,0xD63420+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_AUTO_TRIGGER(0xD63424,0xD63424+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BADGE_LILITHS_GIFT(0xD63428,0xD63428+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
BUNNY_CLOVER(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D887C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D886C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
FAIRYS_FLUTE(0x1679FE4,0x12D8874+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D8884+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8874+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1676F64,0),
BUNNY_MEMORIES(0x1679FE8,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8888-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1676F68,0),
WIND_BLESSING(0x1679FE0,0x12D7870,0x12D8880+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8880-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1676F60,0),
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_MANA_PLUS(0xD633B4,0xD633B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_MANA_SURGE(0xD633B8,0xD633B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_CRISIS_BOOST(0xD633BC,0xD633BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_ATK_GROW(0xD633C0,0xD633C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_DEF_GROW(0xD633C4,0xD633C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_ATK_TRADE(0xD633C8,0xD633C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_DEF_TRADE(0xD633CC,0xD633CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_ARM_STRENGTH(0xD633D0,0xD633D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_CARROT_BOOST(0xD633D4,0xD633D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_WEAKEN(0xD633D8,0xD633D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_SELF_DEFENSE(0xD633DC,0xD633DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_ARMORED(0xD633E0,0xD633E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_LUCKY_SEVEN(0xD633E4,0xD633E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_HEX_CANCEL(0xD633E8,0xD633E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_PURE_LOVE(0xD633EC,0xD633EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_TOXIC_STRIKE(0xD633F0,0xD633F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_FRAME_CANCEL(0xD633F4,0xD633F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_HEALTH_WAGER(0xD633F8,0xD633F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_MANA_WAGER(0xD633FC,0xD633FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_STAMINA_PLUS(0xD63400,0xD63400+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_BLESSED(0xD63404,0xD63404+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_HITBOX_DOWN(0xD63408,0xD63408+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_CASHBACK(0xD6340C,0xD6340C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_SURVIVAL(0xD63410,0xD63410+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_TOP_FORM(0xD63414,0xD63414+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_TOUGH_SKIN(0xD63418,0xD63418+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_ERINA_BADGE(0xD6341C,0xD6341C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_RIBBON_BADGE(0xD63420,0xD63420+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_AUTO_TRIGGER(0xD63424,0xD63424+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
BADGE_LILITHS_GIFT(0xD63428,0xD63428+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HEALTHUP_START(0xD6342C,0xD6342C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
HEALTHUP_END(0xD63528,0xD63528+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
ATTACKUP_START(0xD6352C,0xD6352C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
ATTACKUP_END(0xD63628,0xD63628+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
MANAUP_START(0xD6362C,0xD6362C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
MANAUP_END(0xD63728,0xD63728+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
REGENUP_START(0xD6372C,0xD6372C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
REGENUP_END(0xD63828,0xD63828+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
PACKUP_START(0xD6382C,0xD6382C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
PACKUP_END(0xD63928,0xD63928+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
//13413E8
ITEM_PERCENT(0,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
MAP_PERCENT(0,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
PAUSED(0,0xC969A0,0xC979A0),
ITEM_PERCENT(0x16E8080,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366408,0x16E4900,0), //Float
MAP_PERCENT(0x16E807C,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366404,0x16E48FC,0), //Float
RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T),
PAUSED(0x1038D88,0xC969A0,0xC979A0,0xCBB9AC,0x1036D88,0),
TITLE_SCREEN(0x16E7EFC,0,0,0,0,0), //0 = Title Screen, 255 = Anywhere else
//INTERFACE_GRAPHICS_CONTROLLER(0x16B4B8C,0,0,0,0,0), //A location in memory that stores a lot of interface-related items. USeful for determining title screen.
EVENT_START(0x167A700,0,0,0,0,0),
EVENT_END(0x167AB24,0,0,0,0,0),
MAP_TILE_X(0x13B6D2C,0,0,0,0,0),
MAP_TILE_Y(0x16AA130,0,0,0,0,0),
MAP_AREA_NUMBER(0xD87FA4,0,0,0,0,0),
MAP_REGION_START(0x1672E64,0,0,0,0,0),
MAP_REGION_END(0x16774B3,0,0,0,0,0),
MESSAGE_TIMER(0x16EA4AC,0,0,0,0,0),
MESSAGE_CHARACTER(0x16EA47C,0,0,0,0,0),
MESSAGE_TEXT(0x17A8DE8,0,0,0,0,0), //This references the 27th location of text. Use 27 for TEXTREF value.
MESSAGE_TEXTREF(0x16EA4B0,0,0,0,0,0), //This should be 27 as this allows for MESSAGE_TEXT to be our "custom message" handler.
MAP_AREA_COLOR(0x84C888,0,0,0,0,0), //See https://github.com/wcko87/rabiribi-map-editing/blob/master/docs/room_colors.md for colors.
//Also changes based on music
BOSS_FIGHT(0x16E7D9C,0,0,0,0,0), //Should be 1 when in a boss fight.
AUTOSAVE(0xD34A70,0,0,0,0,0), //1 if autosaving is occurring.
DARKNESS(0x172C2E8,0,0,0,0,0),
PLAYERHEALTH(0x16E90E0,0,0,0,0,0),
;
long offset;
long base_offset;
long offset_v185;
long offset_v188;
long offset_v190;
long offset_v199;
long offset_v199t;
long latest_offset;
MemoryOffset(long offset,long offset_v185,long offset_v188) {
this.offset=offset;
MemoryOffset(long offset,long offset_v185,long offset_v188,long offset_v190,long offset_v199,long offset_v199t) {
this.base_offset=offset;
this.offset_v185=offset_v185;
this.offset_v188=offset_v188;
this.offset_v190=offset_v190;
this.offset_v199=offset_v199;
this.offset_v199t=offset_v199t;
//TODO CHANGE THIS IF PUBLIC VERSION CHANGES!
this.latest_offset = offset_v188;
this.latest_offset = offset_v199t;
}
public long getOffset() {
return latest_offset;
return base_offset+latest_offset;
}
public long getOffsetV175() {
return offset;
public long getOriginalOffset() {
return base_offset;
}
public long getOffsetV185() {
@ -186,4 +218,8 @@ class OffsetHelper{
final static long MEMORY_OFFSET_V188_TO_V1881 = -0x10;
final static long MEMORY_OFFSET_V185_TO_V1881 = KEY_ITEM_OFFSET_V185_TO_V188+MEMORY_OFFSET_V188_TO_V1881;
final static long MEMORY_OFFSET_V175_TO_V1881 = KEY_ITEM_OFFSET_V175_TO_V188+MEMORY_OFFSET_V188_TO_V1881;
final static long MEMORY_OFFSET_V1881_TO_V190 = 0x24018;
final static long MEMORY_OFFSET_V175_TO_V190 = MEMORY_OFFSET_V175_TO_V1881+MEMORY_OFFSET_V1881_TO_V190;
final static long KEY_ITEM_OFFSET_V175_TO_V199 = 0x913BC0;
final static long KEY_ITEM_OFFSET_V175_TO_V199T = 0x916C40;
}

@ -3,6 +3,7 @@ package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
@ -129,6 +130,26 @@ public class RabiRibiModule extends Module{
}, 1000, 1000, TimeUnit.MILLISECONDS);
}
public static void loadModule() {
sigIRC.modules.add(new RabiRibiModule(
new Rectangle(sigIRC.rabiribimodule_X,sigIRC.rabiribimodule_Y,sigIRC.rabiribimodule_width,sigIRC.rabiribimodule_height),
"Rabi Ribi"
));
sigIRC.rabiribimodule_enabled=true;
sigIRC.config.setBoolean("Module_rabiribi_Enabled", sigIRC.rabiribimodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof RabiRibiModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.rabiribimodule_enabled=false;
sigIRC.config.setBoolean("Module_rabiribi_Enabled", sigIRC.rabiribimodule_enabled);
sigIRC.config.saveProperties();
}
public void ApplyConfigWindowProperties() {
sigIRC.rabiribimodule_X=(int)position.getX();
sigIRC.rabiribimodule_Y=(int)position.getY();

@ -15,12 +15,24 @@ import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.swing.Timer;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import sig.FileManager;
import sig.Module;
import sig.sigIRC;
import sig.modules.RabiRibi.MemoryOffset;
import sig.modules.RabiRibi.MemoryType;
import sig.modules.TouhouMother.DataProperty;
import sig.modules.TouhouMother.IncreaseTouhouMotherClockCount;
import sig.modules.TouhouMother.KillButton;
@ -31,6 +43,7 @@ import sig.modules.TouhouMother.TouhouMotherButton;
import sig.modules.TouhouMother.TouhouMotherCharacterData;
import sig.modules.TouhouMother.TouhouPlayerCharacter;
import sig.modules.TouhouMother.UpdateButton;
import sig.modules.utils.PsapiTools;
import sig.modules.utils.SemiValidInteger;
import sig.modules.utils.SemiValidString;
import sig.utils.DrawUtils;
@ -51,6 +64,11 @@ public class TouhouMotherModule extends Module implements ActionListener{
String real_gameData=SemiValidString.ERROR_VALUE;
TouhouMotherBossData[] monsterDatabase;
TouhouMotherCharacterData[] characterDatabase = new TouhouMotherCharacterData[4];
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ;
boolean foundTouhouMother = false;
int touhouMotherPID = -1;
long touhouMotherMemOffset = 0;
public HANDLE touhouMotherProcess = null;
public List<TimeRecord> recordDatabase = new ArrayList<TimeRecord>();
@ -89,12 +107,114 @@ public class TouhouMotherModule extends Module implements ActionListener{
DisableTouhouMotherClockCount();
PopulateRecordDatabase();
DefineButton();
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
CheckTouhouMotherClient();
scheduler.scheduleWithFixedDelay(()->{
CheckTouhouMotherClient();
}, 5000, 5000, TimeUnit.MILLISECONDS);
}
public static void loadModule() {
sigIRC.modules.add(new TouhouMotherModule(
new Rectangle(sigIRC.touhoumothermodule_X,sigIRC.touhoumothermodule_Y,sigIRC.touhoumothermodule_width,sigIRC.touhoumothermodule_height),
"Touhou Mother"
));
sigIRC.touhoumothermodule_enabled=true;
sigIRC.config.setBoolean("Module_touhoumother_Enabled", sigIRC.touhoumothermodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof TouhouMotherModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.touhoumothermodule_enabled=false;
sigIRC.config.setBoolean("Module_touhoumother_Enabled", sigIRC.touhoumothermodule_enabled);
sigIRC.config.saveProperties();
}
private void CheckTouhouMotherClient() {
List<Integer> pids;
try {
pids = PsapiTools.getInstance().enumProcesses();
boolean found=false;
for (Integer pid : pids) {
HANDLE process = Kernel32.INSTANCE.OpenProcess(PROCESS_PERMISSIONS, true, pid);
List<sig.modules.utils.Module> hModules;
try {
hModules = PsapiTools.getInstance().EnumProcessModules(process);
for(sig.modules.utils.Module m: hModules){
/*if (m.getFileName().contains("rpg") || m.getFileName().contains("Touhou")) {
System.out.println(m.getFileName()+":"+m.getEntryPoint());
}*/
if (m.getFileName().contains("RPG_RT")) {
found=true;
if (!foundTouhouMother) {
touhouMotherMemOffset = Pointer.nativeValue(m.getLpBaseOfDll().getPointer());
System.out.println("Found an instance of Touhou Mother at 0x"+Long.toHexString(touhouMotherMemOffset)+" | File:"+m.getFileName()+","+m.getBaseName());
touhouMotherPID=pid;
foundTouhouMother=true;
touhouMotherProcess=process;
break;
}
break;
}
}
if (found) {
break;
}
} catch (Exception e) {
e.printStackTrace();
}
if (process!=null) {
Kernel32.INSTANCE.CloseHandle(process);
}
}
if (!found && foundTouhouMother) {
foundTouhouMother=false;
System.out.println("Touhou Mother process lost.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void actionPerformed(ActionEvent ev) {
memory = FileUtils.readFromFile(sigIRC.BASEDIR+"memory");
//memory = FileUtils.readFromFile(sigIRC.BASEDIR+"memory");
//System.out.println(Arrays.toString(memory));
memory = new String[]{"","","","","","","","","","","","","","","","","","",""};
if (foundTouhouMother) {
memory[0] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A84,0x6DC,0x2C0,0x8,0x6AC,0x2F0));
memory[1] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A90,0x8,0x2E8,0x8,0x6AC,0x2F0));
memory[2] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A88,0x454,0x310,0x8,0x6AC,0x2F0));
memory[3] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A68,0x3B4,0x37C,0x8,0x6AC,0x2F0));
memory[4] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A88,0x6C,0x400,0x8,0x6AC,0x2F0));
memory[5] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2BA0,0x2B0,0x384,0x724,0x4D8,0x2DC));
memory[6] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2BA0,0x584,0x308,0x6C0,0x73C,0x2D0));
memory[7] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A90,0x40,0x5C,0x34,0x6D8,0x190));
memory[8] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A58,0x410,0x734,0x424,0x6DC,0x2F0));
memory[9] = ReadStringFromBuriedMemoryOffset(0xA2BD8,0x68,0xC,0x0,0x0);
memory[10] = ReadStringFromBuriedMemoryOffset(0xA2BD4,0x4,0x9C,0xC,0x0,0x0);
memory[11] = ReadStringFromBuriedMemoryOffset(0xA2B70,0x1F8,0x278,0xC,0x0,0x0);
memory[12] = ReadStringFromBuriedMemoryOffset(0xA2BD8,0x64,0x10,0x690,0x0,0x0);
memory[13] = ReadStringFromBuriedMemoryOffset(0xA2BD8,0x10,0x694,0x690,0x0,0x0);
memory[14] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2BA0,0x654,0x308,0x4D4,0x720,0x140));
memory[15] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2BA0,0x27C,0x6FC,0x4D4,0x720,0x140));
memory[16] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A58,0x144,0x728,0x5C,0x744,0x140));
memory[17] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2BA0,0x1F4,0x774,0x72C,0x4F4,0x140));
memory[18] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A80,0x44,0x5F0,0x2A8,0x3EC,0x2A0));
}
/*System.out.println("Value 1: "+readIntFromMemory(0xA2BD8));
System.out.println("Value 2: "+readIntFromMemoryOffset(0x64,readIntFromMemory(0xA2BD8)));
System.out.println("Value 3: "+readIntFromMemoryOffset(0x10,readIntFromMemoryOffset(0x64,readIntFromMemory(0xA2BD8))));
System.out.println("Value 4: "+readIntFromMemoryOffset(0x690,readIntFromMemoryOffset(0x10,readIntFromMemoryOffset(0x64,readIntFromMemory(0xA2BD8)))));
System.out.println("Value 5: "+readIntFromMemoryOffset(0x0,readIntFromMemoryOffset(0x690,readIntFromMemoryOffset(0x10,readIntFromMemoryOffset(0x64,readIntFromMemory(0xA2BD8))))));
System.out.println("Value 6: "+readStringFromMemoryOffset(0x0,readIntFromMemoryOffset(0x0,readIntFromMemoryOffset(0x690,readIntFromMemoryOffset(0x10,readIntFromMemoryOffset(0x64,readIntFromMemory(0xA2BD8)))))));*/
if (memory.length>=14) {
ProcessMemoryData();
ValidateAndControlMonsterData();
@ -109,6 +229,35 @@ public class TouhouMotherModule extends Module implements ActionListener{
killButton.run();
}
public int ReadIntFromBuriedMemoryOffset(long...offsets) {
int prev_val = 0;
for (int i=0;i<offsets.length;i++) {
if (i==0) {
prev_val = readIntFromMemory(offsets[i]);
} else {
prev_val = readIntFromMemoryOffset(offsets[i],prev_val);
}
}
return prev_val;
}
public String ReadStringFromBuriedMemoryOffset(long...offsets) {
int prev_val = 0;
String final_val = "";
for (int i=0;i<offsets.length;i++) {
if (i==0) {
prev_val = readIntFromMemory(offsets[i]);
} else {
if (i==offsets.length-1) {
final_val = readStringFromMemoryOffset(offsets[i],prev_val);
} else {
prev_val = readIntFromMemoryOffset(offsets[i],prev_val);
}
}
}
return final_val;
}
public void run() {
EnableAndDisableTimer();
@ -465,6 +614,10 @@ public class TouhouMotherModule extends Module implements ActionListener{
monsterdata.add(new TouhouMotherBossData("Miss Satori", 108, 900000, "TME_108.png"));
monsterdata.add(new TouhouMotherBossData("Only God", 48, 4010, "TME_48.png"));
monsterDatabase = monsterdata.toArray(new TouhouMotherBossData[monsterdata.size()]);
FileManager manager;
for (TouhouMotherBossData boss : monsterDatabase) {
manager = new FileManager("Boss Sprites/"+boss.getImage()); manager.verifyAndFetchFileFromServer();
}
}
/**
@ -522,4 +675,90 @@ public class TouhouMotherModule extends Module implements ActionListener{
public Rectangle2D getBounds() {
return position;
}
public int readIntFromMemory(long offset) {
Memory mem = new Memory(4);
if (!Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(touhouMotherMemOffset+offset), mem, 4, null)) {
return -1;
} else {
return mem.getInt(0);
}
}
public float readFloatFromMemory(long offset) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(touhouMotherMemOffset+offset), mem, 4, null);
return mem.getFloat(0);
}
public float readFloatFromMemoryOffset(long val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(pointer+val), mem, 4, null);
return mem.getFloat(0);
}
public int readIntFromMemoryOffset(long val, long pointer) {
Memory mem = new Memory(4);
if (!Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(pointer+val), mem, 4, null)) {
return -1;
} else {
return mem.getInt(0);
}
}
public String readStringFromMemoryOffset(long val, long pointer) {
Memory mem = new Memory(128);
if (!Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(pointer+val), mem, 128, null)) {
return "";
} else {
return mem.getString(0);
}
}
public float readDirectFloatFromMemoryLocation(long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(pointer), mem, 4, null);
return mem.getFloat(0);
}
public int readDirectIntFromMemoryLocation(long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(pointer), mem, 4, null);
return mem.getInt(0);
}
public int readIntFromPointer(long val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(readIntFromMemory(pointer)+val), mem, 4, null);
return mem.getInt(0);
}
public float readFloatFromPointer(long val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(readIntFromMemory(pointer)+val), mem, 4, null);
return mem.getFloat(0);
}
public int readIntFromMemory(MemoryOffset val) {
return (int)readFromMemory(val,MemoryType.INTEGER);
}
public float readFloatFromMemory(MemoryOffset val) {
return (float)readFromMemory(val,MemoryType.FLOAT);
}
Object readFromMemory(MemoryOffset val, MemoryType type) {
Memory mem = new Memory(type.getSize());
Kernel32.INSTANCE.ReadProcessMemory(touhouMotherProcess, new Pointer(touhouMotherMemOffset+val.getOffset()), mem, type.getSize(), null);
switch (type) {
case FLOAT:
return mem.getFloat(0);
case INTEGER:
return mem.getInt(0);
default:
System.out.println("WARNING! Type "+type+" does not have a defined value.");
return -1;
}
}
}

@ -1,45 +1,43 @@
package sig.modules.Twitch;
import java.io.File;
import java.text.DateFormat;
import com.mb3364.twitch.api.models.User;
import sig.modules.TwitchModule;
import sig.utils.FileUtils;
public class Announcement {
User userData;
Follower userData;
long twitchID;
public Announcement(long twitchID) {
String userFilePath = TwitchModule.USERDIR+twitchID;
File userFile = new File(userFilePath);
if (userFile.exists()) {
int i=0;
String[] contents = FileUtils.readFromFile(userFilePath);
userData = new User();
int i=1;
userData.setId(twitchID);
userData.setBio(contents[i++]);
userData.setDisplayName(contents[i++]);
userData.setLogo(contents[i++]);
userData.setName(contents[i++]);
userData.setType(contents[i++]);
userData = new Follower(twitchID,
contents[1],
contents[0],
contents[2],
contents[3],
contents[4],
contents[5],
contents[6]);
} else {
System.out.println("WARNING! Could not find user with ID "+twitchID+"!");
}
this.twitchID=twitchID;
}
public Announcement(User data) {
public Announcement(Follower data) {
this.userData=data;
this.twitchID=data.getId();
this.twitchID=data.id;
}
public String toString() {
return userData.toString();
}
public User getUser() {
public Follower getUser() {
return userData;
}
}

@ -0,0 +1,47 @@
package sig.modules.Twitch;
public class Follower {
public long id;
public String bio;
public String created_at;
public String display_name;
public String logo_url;
public String name;
public String type;
public String updated_at;
Follower(Long id,
String bio,
String created_at,
String display_name,
String logo_url,
String name,
String type,
String updated_at) {
this.id=id;
this.bio = bio;
this.created_at = created_at;
this.display_name = display_name;
this.logo_url = logo_url;
this.name = name;
this.type = type;
this.updated_at = updated_at;
}
public Follower(String id,
String bio,
String created_at,
String display_name,
String logo_url,
String name,
String type,
String updated_at) {
this(Long.parseLong(id),
bio,
created_at,
display_name,
logo_url,
name,
type,
updated_at
);
}
}

@ -12,6 +12,8 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@ -21,17 +23,15 @@ import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.SwingUtilities;
import com.mb3364.twitch.api.handlers.ChannelFollowsResponseHandler;
import com.mb3364.twitch.api.handlers.StreamResponseHandler;
import com.mb3364.twitch.api.handlers.UserResponseHandler;
import com.mb3364.twitch.api.models.ChannelFollow;
import com.mb3364.twitch.api.models.Stream;
import com.mb3364.twitch.api.models.User;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import sig.Module;
import sig.sigIRC;
import sig.modules.Twitch.Announcement;
import sig.modules.Twitch.FancyNumber;
import sig.modules.Twitch.Follower;
import sig.utils.DrawUtils;
import sig.utils.FileUtils;
import sig.utils.SoundUtils;
@ -51,17 +51,19 @@ public class TwitchModule extends Module{
int lastFollowerCheck=300;
final static int FOLLOWERANNOUNCEMENTTIME = 300;
int lastFollowerAnnouncement=0;
User announcedFollowerUser;
//User announcedFollowerUser;
String[] followersounds = new String[]{"Glaceon_cry.wav"};
FancyNumber viewers_numb;
FancyNumber followers_numb;
FancyNumber views_numb;
Date uptime = Calendar.getInstance().getTime();
ZonedDateTime uptime;
String currentlyPlaying=" ";
final public static int ARROWTIMER = 3000;
public static BufferedImage UPARROWIMAGE;
public static BufferedImage DOWNARROWIMAGE;
public static BufferedImage UPTIMEIMAGE;
public static long myTwitchChannelID = 0;
public int previous_xoffset = 0;
public TwitchModule(Rectangle2D bounds, String moduleName) {
this(bounds,moduleName,true);
@ -81,6 +83,11 @@ public class TwitchModule extends Module{
if (firstTime) {
CreateFollowerQueueLog();
}
ClearFollowerAnnouncerQueue();
//myTwitchChannelID = getMyChannelID();
/*manager.streams().get("theduckishot", new StreamResponseHandler() {
@Override
@ -128,6 +135,26 @@ public class TwitchModule extends Module{
});*/
}
public static void loadModule() {
sigIRC.modules.add(new TwitchModule(
new Rectangle(sigIRC.twitchmodule_X,sigIRC.twitchmodule_Y,sigIRC.twitchmodule_width,sigIRC.twitchmodule_height),
"Twitch"
));
sigIRC.twitchmodule_enabled=true;
sigIRC.config.setBoolean("Module_twitch_Enabled", sigIRC.twitchmodule_enabled);
sigIRC.config.saveProperties();
}
public static void unloadModule() {
for (int i=0;i<sigIRC.modules.size();i++) {
if (sigIRC.modules.get(i) instanceof TwitchModule) {
sigIRC.modules.remove(sigIRC.modules.get(i));
}
}
sigIRC.twitchmodule_enabled=false;
sigIRC.config.setBoolean("Module_twitch_Enabled", sigIRC.twitchmodule_enabled);
sigIRC.config.saveProperties();
}
private void InitializeFollowerSounds() {
File follower_sounds_dir = new File(SOUNDSDIR);
String[] files = filterFiles(follower_sounds_dir.list());
@ -157,9 +184,24 @@ public class TwitchModule extends Module{
public void run() {
if (lastFollowerCheck--<=0) {
lastFollowerCheck = FOLLOWERCHECKTIMER;
getFollowers(false);
//getFollowers(false);
try {
GetFollowerAndStreamData();
} catch (IOException e1) {
e1.printStackTrace();
}
popFollowerFromQueue();
isStreamOnline(true);
try {
//System.out.println("Checking Followers...");
JSONObject FollowerData = GetFollowerAndStreamData();
followers_numb.updateValue(FollowerData.getInt("total"));
//views_numb.updateValue(FollowerData.get);
} catch (JSONException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// isStreamOnline(true);
}
if (lastFollowerAnnouncement>0) {
lastFollowerAnnouncement--;
@ -167,6 +209,41 @@ public class TwitchModule extends Module{
//System.out.println(lastFollowerCheck);
}
public JSONObject GetFollowerAndStreamData() throws IOException {
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/streams?user_id="+sigIRC.channel_id, "stream_info",true);
JSONObject streamInfo = FileUtils.readJsonFromFile("stream_info");
JSONArray streamData = streamInfo.getJSONArray("data");
streamOnline = streamData.length()!=0;
if (streamOnline) {
JSONObject stream = streamData.getJSONObject(0);
DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter
.ofPattern("uuuu-MM-dd'T'HH:mm:ssz");
uptime = ZonedDateTime.parse(stream.getString("started_at"),DATE_TIME_FORMATTER);
viewers_numb.updateValue(stream.getInt("viewer_count"));
//System.out.println(stream.getString("game_id"));
if (stream.getString("game_id").length()>0 && !stream.getString("game_id").equalsIgnoreCase("null")) {
int gameID = Integer.parseInt(stream.getString("game_id"));
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/games?id="+gameID, "game_info",true);
JSONObject gameData = FileUtils.readJsonFromFile("game_info");
currentlyPlaying = gameData.getJSONArray("data").getJSONObject(0).getString("name");
} else {
currentlyPlaying = "";
}
}
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users/follows?to_id="+sigIRC.channel_id, "temp_followers",true);
JSONObject FollowerData = FileUtils.readJsonFromFile("temp_followers");
JSONArray data = FollowerData.getJSONArray("data");
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users?id="+sigIRC.channel_id, "channel_info",true);
JSONObject channelData = FileUtils.readJsonFromFile("channel_info").getJSONArray("data").getJSONObject(0);
views_numb.updateValue(channelData.getInt("view_count"));
for (int i=0;i<data.length();i++) {
JSONObject user = data.getJSONObject(i);
addFollower(user.getString("from_name"),user.getLong("from_id"),streamOnline,false);
}
return FollowerData;
}
public void ApplyConfigWindowProperties() {
sigIRC.twitchmodule_X=(int)position.getX();
sigIRC.twitchmodule_Y=(int)position.getY();
@ -176,20 +253,22 @@ public class TwitchModule extends Module{
private void popFollowerFromQueue() {
if (sigIRC.testMode) {
User user = new User();
user.setDisplayName("Test User"+((int)Math.random()*100000));
user.setBio("I am an awesome test subject.");
user.setName(user.getDisplayName());
user.setLogo("http://45.33.13.215/sigIRCv2/sigIRC/sigIRCicon.png");
Follower user = new Follower("0","I am an awesome test subject.",
new Date().toString(),
"Test User"+((int)Math.random()*100000),
"http://45.33.13.215:8080/sigIRCv2/sigIRC/sigIRCicon.png",
"Test User",
"",
new Date().toString());
DisplayFollowerAnnouncement(user,true);
} else
if (follower_queue.size()>0) {
if (isStreamOnline()) {
if (streamOnline) {
//We have a follower to announce!
Announcement a = follower_queue.remove(0);
User user = a.getUser();
if (user.getDisplayName().length()>0 &&
!user.getDisplayName().contains("?")) {
Follower user = a.getUser();
if (user.display_name.length()>0 &&
!user.display_name.contains("?")) {
DisplayFollowerAnnouncement(user,true);
} else {
DisplayFollowerAnnouncement(user,false);
@ -207,22 +286,25 @@ public class TwitchModule extends Module{
private void StoreRemainingFollowers() {
for (Announcement a : follower_queue) {
FileUtils.logToFile(Long.toString(a.getUser().getId()), FOLLOWERQUEUEFILE);
FileUtils.logToFile(Long.toString(a.getUser().id), FOLLOWERQUEUEFILE);
}
follower_queue.clear();
}
private void DisplayFollowerAnnouncement(User user, boolean useNickname) {
public static Follower announcedFollowerUser;
private void DisplayFollowerAnnouncement(Follower user, boolean useNickname) {
lastFollowerAnnouncement = FOLLOWERANNOUNCEMENTTIME;
if (!useNickname) {
user.setDisplayName(user.getName());
user.display_name=user.name;
}
announcedFollowerUser = user;
String followerAnnouncement = user.getDisplayName()+" is now following the stream!";
String userlogo = USERDIR+user.getId()+"_logo";
if (user.getLogo()!=null && !user.getLogo().equalsIgnoreCase("null")) {
String followerAnnouncement = user.display_name+" is now following the stream!";
String userlogo = USERDIR+user.id+"_logo";
if (user.logo_url!=null && !user.logo_url.equalsIgnoreCase("null")) {
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL(user.getLogo()),new File(userlogo));
org.apache.commons.io.FileUtils.copyURLToFile(new URL(user.logo_url),new File(userlogo));
File logo = new File(userlogo);
if (logo.exists()) {
followerUserLogo = ImageIO.read(logo);
@ -267,30 +349,6 @@ public class TwitchModule extends Module{
}
}
private void getFollowers(boolean firstTime) {
sigIRC.manager.channels().getFollows(TextUtils.getActualChannelName(), new ChannelFollowsResponseHandler() {
@Override
public void onSuccess(int total, java.util.List<ChannelFollow> follows) {
//System.out.println("Successfully found followers for channel "+sigIRC.channel+". Total: "+total);
//console = "Last Follower: "+follows.get(0).getUser().getDisplayName();
for (ChannelFollow f : follows) {
addFollower(f,isStreamOnline(),firstTime);
}
}
@Override
public void onFailure(Throwable arg0) {
}
@Override
public void onFailure(int arg0, String arg1, String arg2) {
System.out.println(arg0+","+arg1+","+arg2);
}
}
);
if (isStreamOnline()) {/*System.out.println("Stream is Online...Clearing Follower Queue.");*/ClearFollowerAnnouncerQueue();}
}
private void ClearFollowerAnnouncerQueue() {
String[] contents = FileUtils.readFromFile(FOLLOWERQUEUEFILE);
//System.out.println("Contents: "+Arrays.toString(contents));
@ -302,104 +360,56 @@ public class TwitchModule extends Module{
}
}
}
private boolean isStreamOnline() {
return isStreamOnline(false);
}
private boolean isStreamOnline(boolean update) {
if (update) {
sigIRC.manager.streams().get(TextUtils.getActualChannelName(), new StreamResponseHandler() {
@Override
public void onFailure(Throwable arg0) {
TwitchModule.streamOnline=false;
}
@Override
public void onFailure(int arg0, String arg1, String arg2) {
System.out.println(arg0+","+arg1+","+arg2);
TwitchModule.streamOnline=false;
}
@Override
public void onSuccess(Stream arg0) {
//System.out.println("Stream data is available! "+arg0);
if (arg0==null) {
TwitchModule.streamOnline=false;
} else {
TwitchModule.streamOnline=true;
UpdateAllStreamStatistics(arg0);
}
}
private void UpdateAllStreamStatistics(Stream data) {
if (data!=null) {
if (data.getGame()!=null && data.getGame().length()>0) {
currentlyPlaying = data.getGame();
}
if (data.getCreatedAt()!=null) {
uptime = data.getCreatedAt();
}
viewers_numb.updateValue(data.getViewers());
views_numb.updateValue((int)data.getChannel().getViews());
followers_numb.updateValue(data.getChannel().getFollowers());
}
}
});
return TwitchModule.streamOnline;
} else {
return TwitchModule.streamOnline;
}
//TwitchModule.streamOnline=true;
//return true;
}
protected void addFollower(ChannelFollow f, boolean streamOnline, boolean silent) {
String filename = USERDIR+f.getUser().getId();
protected void addFollower(String username, long id, boolean streamOnline, boolean silent) {
String filename = USERDIR + Long.toString(id);
File userProfile = new File(filename);
if (!userProfile.exists()) {
CreateUserProfile(username, id, filename, userProfile);
if (!silent) { //If we got in here, this isn't the initial follower setup, so we are good to go with announcing these followers.
if (!streamOnline) {
//Save their ID to a queue.
FileUtils.logToFile(Long.toString(f.getUser().getId()), FOLLOWERQUEUEFILE);
FileUtils.logToFile(Long.toString(id), FOLLOWERQUEUEFILE);
} else {
//Announce it now.
//System.out.println("Stream is online...");
AnnounceFollower(f);
AnnounceFollower(username,id);
}
}
CreateUserProfile(f, filename, userProfile);
}
}
private void CreateUserProfile(ChannelFollow f, String filename, File userProfile) {
private void CreateUserProfile(String username, long id, String filename, File userProfile) {
try {
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users?id="+id, "user_info",true);
System.out.println("File data: "+Arrays.toString(FileUtils.readFromFile("user_info")));
JSONObject userdata = FileUtils.readJsonFromFile("user_info").getJSONArray("data").getJSONObject(0);
userProfile.createNewFile();
FileUtils.logToFile(DateFormat.getDateInstance().format(f.getCreatedAt()), filename);
FileUtils.logToFile(f.getUser().getBio(), filename);
FileUtils.logToFile(f.getUser().getDisplayName(), filename);
FileUtils.logToFile(f.getUser().getLogo(), filename);
FileUtils.logToFile(f.getUser().getName(), filename);
FileUtils.logToFile(f.getUser().getType(), filename);
FileUtils.logToFile(DateFormat.getDateInstance().format(f.getUser().getUpdatedAt()), filename);
System.out.println("Profile Image URL: "+userdata.getString("profile_image_url"));
FileUtils.logToFile(new Date().toString(), filename);
FileUtils.logToFile(userdata.getString("description"), filename);
FileUtils.logToFile(username, filename);
FileUtils.logToFile(userdata.getString("profile_image_url"), filename);
FileUtils.logToFile(userdata.getString("login"), filename);
FileUtils.logToFile(userdata.getString("type"), filename);
FileUtils.logToFile(new Date().toString(), filename);
} catch (IOException e) {
e.printStackTrace();
}
}
private void AnnounceFollower(ChannelFollow f) {
//System.out.println("Thanks for following "+f.getUser().getDisplayName()+"!");
AddFollowerToQueue(f.getUser());
private void AnnounceFollower(String name,long id) {
System.out.println("Thanks for following "+name+"!");
AddFollowerToQueue(id);
}
private void AddFollowerToQueue(int id) {
private void AddFollowerToQueue(long id) {
follower_queue.add(new Announcement(id));
}
private void AddFollowerToQueue(User user) {
follower_queue.add(new Announcement(user));
}
// private void AddFollowerToQueue(User user) {
// follower_queue.add(new Announcement(user));
// }
private boolean CreateUserFolder() {
File userDir = new File(USERDIR);
@ -433,6 +443,7 @@ public class TwitchModule extends Module{
g.fillPolygon(new int[]{(int)position.getX(),(int)(position.getX()+position.getWidth()),(int)(position.getX()+position.getWidth()),(int)position.getX()},
new int[]{yoffset-4,yoffset-4,yoffset+16,yoffset+16},
4);
previous_xoffset = xoffset;
if (currentlyPlaying!=null && currentlyPlaying.length()>0) {
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, xoffset, yoffset+TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getHeight()/2+3, 2, g.getColor(), new Color(195,195,195), currentlyPlaying);xoffset+=TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getWidth()+16;
}
@ -446,7 +457,7 @@ public class TwitchModule extends Module{
int xoffset = 0;
int yoffset = 0;
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, sigIRC.panel);xoffset+=UPTIMEIMAGE.getWidth()+4;
String timediff = TimeUtils.GetTimeDifferenceFromCurrentDate(uptime);
String timediff = TimeUtils.GetTimeDifferenceFromCurrentDate(Date.from(uptime.toInstant()));
if (timediff.length()>0) {
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(timediff, sigIRC.panel.userFont).getHeight()/2+3,new Color(184,181,192),timediff);xoffset+=TextUtils.calculateStringBoundsFont(timediff, sigIRC.panel.userFont).getWidth()+12;
}
@ -478,23 +489,24 @@ public class TwitchModule extends Module{
//g.drawImage(follower_img, (int)bounds.getX(), (int)bounds.getY(), , , sigIRC.panel)
g.drawImage(follower_img, (int)position.getX(), (int)position.getY()+canvasYOffset, (int)position.getX()+follower_img.getWidth()+canvasXOffset, (int)position.getY()+follower_img.getHeight(),
-xAlteration, 0, follower_img.getWidth(), follower_img.getHeight()-yAlteration, sigIRC.panel);
Rectangle2D usernameTextsize = TextUtils.calculateStringBoundsFont(announcedFollowerUser.getDisplayName(), sigIRC.panel.programFont);
Rectangle2D usernameTextsize = TextUtils.calculateStringBoundsFont(announcedFollowerUser.display_name, sigIRC.panel.programFont);
int textY = (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration;
int textX = (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration;
if (textY<position.getY()+position.getHeight() && textX+usernameTextsize.getWidth()>position.getX()) {
DrawUtils.drawCenteredText(g, sigIRC.panel.programFont, (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration, (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration, Color.BLACK, announcedFollowerUser.getDisplayName());
//DrawUtils.drawCenteredText(g, sigIRC.panel.programFont, (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration, (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration, Color.BLACK, announcedFollowerUser.display_name);
DrawUtils.drawCenteredOutlineText(g, sigIRC.panel.programFont, (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration, (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration, sigIRC.twitchmodule_newfollowerNameShadowSize, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerNameTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerNameShadowColor), announcedFollowerUser.display_name);
}
if (announcedFollowerUser.getBio()!=null && !announcedFollowerUser.getBio().equalsIgnoreCase("null")) {
if (announcedFollowerUser.bio!=null && !announcedFollowerUser.bio.equalsIgnoreCase("null")) {
if (followerUserLogo!=null) {
final int image_size = sigIRC.twitchmodule_newfollowerImgLogoSize;
int img_startx = (int)(position.getX()+position.getWidth()-ticksPassed*3-(image_size+4));
int img_starty = (int)(position.getY()+follower_img.getHeight()+2-image_size/2);
//g.setColor(Color.BLACK);
//g.drawRect(img_startx, img_starty, image_size, image_size);
g.setColor(Color.BLACK);
g.drawRect(img_startx, img_starty, image_size, image_size);
g.drawImage(followerUserLogo, img_startx, img_starty, img_startx+image_size, img_starty+image_size, 0, 0, followerUserLogo.getWidth(), followerUserLogo.getHeight(), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerImgBackgroundColor), sigIRC.panel);
}
if (announcedFollowerUser.getBio()!=null && announcedFollowerUser.getBio().length()>0) {
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, position.getX()+position.getWidth()-ticksPassed*3, position.getY()+follower_img.getHeight()+2+8, 2, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerShadowTextColor), announcedFollowerUser.getBio());
if (announcedFollowerUser.bio!=null && announcedFollowerUser.bio.length()>0) {
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, position.getX()+position.getWidth()-ticksPassed*3, position.getY()+follower_img.getHeight()+2+8, 2, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerShadowTextColor), announcedFollowerUser.bio);
}
}
}

@ -50,7 +50,7 @@ public class PsapiTools {
boolean success = psapi.EnumProcessModules(hProcess, lphModule, lphModule.length, lpcbNeededs);
if (!success){
int err=k32.GetLastError();
if (err!=6) {
if (err!=6 && err!=299) {
throw new Exception("EnumProcessModules failed. Error: "+err);
}
}

@ -36,7 +36,7 @@ public class SemiValidInteger {
if (TextUtils.isNumeric(vals[i])) {
double d = Double.parseDouble(vals[i]);
if (d>Integer.MAX_VALUE) {
System.out.println("Double: "+d+" Val:"+vals[i]);
//System.out.println("Double: "+d+" Val:"+vals[i]);
vals[i] = Integer.toString((int)(d-((double)Integer.MAX_VALUE*2))-2);
}
}

@ -6,12 +6,6 @@ import javax.swing.Timer;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.mb3364.twitch.api.Twitch;
import com.mb3364.twitch.api.handlers.ChannelResponseHandler;
import com.mb3364.twitch.api.handlers.StreamResponseHandler;
import com.mb3364.twitch.api.models.Channel;
import com.mb3364.twitch.api.models.Stream;
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
@ -22,14 +16,17 @@ import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import sig.modules.BandoriModule;
import sig.modules.ChatLogModule;
import sig.modules.ControllerModule;
import sig.modules.DDRStepModule;
import sig.modules.RabiRaceModule;
import sig.modules.RabiRibiModule;
import sig.modules.TouhouMotherModule;
import sig.modules.TwitchModule;
import sig.modules.ChatLog.ChatLogMessage;
import sig.modules.ChatLog.ChatLogTwitchEmote;
import sig.modules.Controller.ControlConfigurationWindow;
import sig.modules.utils.MyKernel32;
import sig.modules.utils.PsapiTools;
import sig.utils.FileUtils;
@ -56,12 +53,14 @@ import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.SocketException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimerTask;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
@ -78,7 +77,7 @@ public class sigIRC{
public static List<CustomSound> customsounds = new ArrayList<CustomSound>();
public static List<Module> modules = new ArrayList<Module>();
static UpdateEvent updater = new UpdateEvent();
static Timer programClock = new Timer(32,updater);
static Timer programClock = new Timer(33,updater);
final public static int BASESCROLLSPD = 4;
final public static int ROWSEPARATION = 64;
final public static String BASEDIR = "./";
@ -96,9 +95,10 @@ public class sigIRC{
static int dingThreshold;
static Color backgroundcol;
public static BackgroundColorButton button;
public static ModuleSelectorButton modulebutton;
public static JFrame window;
static boolean overlayMode=false;
static boolean showWindowControls=false;
public static boolean showWindowControls=false;
static int windowX=0;
static int windowY=0;
static int windowWidth=0;
@ -109,8 +109,11 @@ public class sigIRC{
static String messageFont="Gill Sans Ultra Bold Condensed";
static String usernameFont="GillSansMTStd-Book";
static String touhoumotherConsoleFont="Agency FB Bold";
static boolean touhoumothermodule_enabled=false;
static boolean twitchmodule_enabled=true;
static Integer messageFontSize = 24;
static Integer usernameFontSize = 16;
static Integer touhoumotherConsoleFontSize = 12;
public static boolean touhoumothermodule_enabled=false;
public static boolean twitchmodule_enabled=true;
public static boolean chatlogmodule_enabled=true;
static boolean downloadsComplete=false;
static boolean hardwareAcceleration=true;
@ -135,6 +138,16 @@ public class sigIRC{
public static int rabiribimodule_height=312;
public static int rabiribimodule_X=0;
public static int rabiribimodule_Y=312;
public static int bandorimodule_width=320;
public static int bandorimodule_height=312;
public static int bandorimodule_X=0;
public static int bandorimodule_Y=312;
public static int ddrstepmodule_width=320;
public static int ddrstepmodule_height=312;
public static int ddrstepmodule_X=0;
public static int ddrstepmodule_Y=312;
public static boolean ddrstepmodule_enabled=false;
public static boolean bandorimodule_enabled=false;
public static boolean rabiribimodule_enabled=false;
public static int rabiracemodule_width=320;
public static int rabiracemodule_height=312;
@ -150,6 +163,9 @@ public class sigIRC{
public static String twitchmodule_newfollowerImgBackgroundColor="90,90,90";
public static String twitchmodule_newfollowerShadowTextColor="26,90,150";
public static String twitchmodule_newfollowerTextColor="255,255,255";
public static String twitchmodule_newfollowerNameTextColor="0,0,0";
public static String twitchmodule_newfollowerNameShadowColor="255,255,180";
public static int twitchmodule_newfollowerNameShadowSize=2;
public static String chatlogmodule_backgroundColor="195,195,195,255";
public static int twitchmodule_newfollowerImgLogoSize=32;
public static boolean testMode=false;
@ -159,8 +175,14 @@ public class sigIRC{
public static int lastSubEmoteUpdate = -1;
public static boolean autoUpdateProgram = true;
public static Image programIcon;
final public static int MAX_CONNECTION_RETRIES = 100;
//final public static int MAX_CONNECTION_RETRIES = 100;
public static String CLIENTID = "";
public static int retryCounter = 0;
public static boolean newUpdateIsAvailable = false;
public static long lastRetryTime = 0l;
public static long lastRetryMessage = 0l;
public static int retryCount = 0;
public static List<ModuleLinker> moduleList;
public static int subchannelCount = 0;
public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>();
@ -171,15 +193,41 @@ public class sigIRC{
static int lastWindowX = 0;
static int lastWindowY = 0;
public static Twitch manager = new Twitch();
public static String longString = "10988989d";
public static ModuleSelector moduleSelectorWindow;
public static String oauth;
public static void main(String[] args) {
String[] filedata = FileUtils.readFromFile(BASEDIR+"sigIRC/oauthToken.txt");
oauth = filedata[0];
//filedata = FileUtils.readFromFile("user_data");
JSONObject data;
try {
FileUtils.downloadFileFromUrl("https://id.twitch.tv/oauth2/validate", "user_data");
data = FileUtils.readJsonFromFile("user_data");
sigIRC.CLIENTID = data.getString("client_id");
} catch (JSONException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
config = InitializeConfigurationFile();
server = config.getProperty("server");
nickname = config.getProperty("nickname");
channel = config.getProperty("channel");
try {
channel_id = sigIRC.GetChannelID(channel.replace("#", ""));
} catch (IOException e) {
e.printStackTrace();
}
overlayMode = config.getBoolean("overlayMode", false);
showWindowControls = config.getBoolean("showWindowControls", true);
windowX = config.getInteger("windowX", 0);
@ -194,6 +242,9 @@ public class sigIRC{
messageFont = config.getProperty("messageFont","Gill Sans Ultra Bold Condensed");
usernameFont = config.getProperty("usernameFont","Segoe UI Semibold");
touhoumotherConsoleFont = config.getProperty("touhoumotherConsoleFont","Agency FB Bold");
messageFontSize = config.getInteger("messageFontSize",24);
usernameFontSize = config.getInteger("usernameFontSize",16);
touhoumotherConsoleFontSize = config.getInteger("touhouMotherConsoleFontSize",12);
touhoumothermodule_enabled = config.getBoolean("Module_touhoumother_Enabled",false);
controllermodule_enabled = config.getBoolean("Module_controller_Enabled",false);
twitchmodule_enabled = config.getBoolean("Module_twitch_Enabled",true);
@ -203,7 +254,7 @@ public class sigIRC{
twitchmodule_follower_img = config.getProperty("TWITCH_module_follower_img","sigIRC/glaceon_follower.png");
twitchmodule_follower_img_animation = config.getBoolean("TWITCH_module_follower_img_animation",true);
twitchmodule_followerText_centerX = config.getInteger("TWITCH_module_followerText_centerX",292);
twitchmodule_followerText_Y = config.getInteger("TWITCH_module_followerText_Y",42);
twitchmodule_followerText_Y = config.getInteger("TWITCH_module_followerText_Y",84);
twitchmodule_newfollowerImgLogoSize = config.getInteger("TWITCH_module_newFollowerImgLogoSize",32);
twitchmodule_newfollowerImgBackgroundColor = config.getProperty("TWITCH_module_newFollowerImgBackgroundColor","90,90,90");
twitchmodule_newfollowerShadowTextColor = config.getProperty("TWITCH_module_newFollowerShadowTextColor","26,90,150");
@ -220,6 +271,16 @@ public class sigIRC{
rabiribimodule_width = config.getInteger("RABIRIBI_module_width",320);
rabiribimodule_height = config.getInteger("RABIRIBI_module_height",312);
rabiribimodule_enabled = config.getBoolean("Module_rabiribi_Enabled", false);*/
bandorimodule_X = config.getInteger("BANDORI_module_X", 240);
bandorimodule_Y = config.getInteger("BANDORI_module_Y", 0);
bandorimodule_width = config.getInteger("BANDORI_module_width", 640);
bandorimodule_height = config.getInteger("BANDORI_module_height", 120);
bandorimodule_enabled = config.getBoolean("Module_bandori_Enabled", false);
ddrstepmodule_X = config.getInteger("ddrstep_module_X", 240);
ddrstepmodule_Y = config.getInteger("ddrstep_module_Y", 0);
ddrstepmodule_width = config.getInteger("ddrstep_module_width", 640);
ddrstepmodule_height = config.getInteger("ddrstep_module_height", 120);
ddrstepmodule_enabled = config.getBoolean("Module_ddrstep_Enabled", false);
rabiracemodule_X = config.getInteger("RABIRACE_module_X",0);
rabiracemodule_Y = config.getInteger("RABIRACE_module_Y",312);
rabiracemodule_width = config.getInteger("RABIRACE_module_width",320);
@ -239,14 +300,18 @@ public class sigIRC{
autoUpdateProgram = config.getBoolean("Automatically_Update_Program", true);
disableChatMessages = config.getBoolean("Disable_Chat_Messages", false);
lastSubEmoteUpdate = config.getInteger("lastSubEmote_APIUpdate",Calendar.getInstance().get(Calendar.DAY_OF_YEAR));
manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem");
twitchmodule_newfollowerNameTextColor = config.getProperty("TWITCH_module_newfollowerNameTextColor","0,0,0");
twitchmodule_newfollowerNameShadowColor = config.getProperty("TWITCH_module_newfollowerNameShadowColor","255,255,180");
twitchmodule_newfollowerNameShadowSize = config.getInteger("TWITCH_module_newfollowerNameShadowSize",2);
//manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem");
//System.out.println(manager.auth().hasAccessToken());
DownloadAllRequiredDependencies();
String[] filedata = FileUtils.readFromFile(BASEDIR+"sigIRC/oauthToken.txt");
final String oauth = filedata[0];
/*try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("https://bandori.party/api/"),new File("testing"));
} catch (IOException e) {
e.printStackTrace();
}*/
Initialize();
@ -294,11 +359,13 @@ public class sigIRC{
manager = new FileManager("sigIRC/Emotes/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/subscribers.txt"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/logs/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/sub_emotes/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/sounds/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/rabi-ribi/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/rabi-ribi/unknown.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/rabi-ribi/characters",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/rabi-ribi/items",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("Boss Sprites/",true); manager.verifyAndFetchFileFromServer();
//manager = new FileManager("sigIRC/sounds/Glaceon_cry.wav"); manager.verifyAndFetchFileFromServer();
File follower_sounds_folder = new File(BASEDIR+"sigIRC/follower_sounds");
if (!follower_sounds_folder.exists()) {
@ -320,12 +387,18 @@ public class sigIRC{
manager = new FileManager("sigIRC/controller/controller_overlay.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/controller/controller_template.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/CP_Font.ttf"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/collect_item.wav"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("kill.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("memory"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("swap.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("update.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("backcolor.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("modules.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("drag_bar.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("map_icons.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/stamps1.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/stamps2_2.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/stamp_what_a_great_idea.png"); manager.verifyAndFetchFileFromServer();
DownloadProgramUpdate();
System.out.println("Downloaded Dependencies. ");
}
@ -352,10 +425,10 @@ public class sigIRC{
} catch (IOException e) {
e.printStackTrace();
}
newUpdateIsAvailable = true;
}
}
}
private static void InitializeModules() {
try {
Module.IMG_DRAGBAR = ImageIO.read(new File(sigIRC.BASEDIR+"drag_bar.png"));
@ -399,6 +472,16 @@ public class sigIRC{
"Rabi-Race"
));
}
if (bandorimodule_enabled) {
BandoriModule.loadModule();
}
if (ddrstepmodule_enabled) {
modules.add(new DDRStepModule(
new Rectangle(ddrstepmodule_X,ddrstepmodule_Y,ddrstepmodule_width,ddrstepmodule_height),
"DDR Step"
));
}
moduleSelectorWindow = new ModuleSelector();
}
private static void InitializeCustomSounds() {
@ -427,17 +510,30 @@ public class sigIRC{
writer.flush();
runIRCLoop(channel, writer, reader);
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (UnknownHostException | SocketException e) {
//e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if (retryCounter<MAX_CONNECTION_RETRIES) {
InitializeIRCConnection(server,nickname,channel,oauth);
} else {
sigIRC.panel.addMessage("Connection timed out. Please restart and try again.");
System.out.println("Connection timed out. Please restart and try again.");
}
new java.util.Timer().schedule(new TimerTask() {
public void run() {
InitializeIRCConnection(server,nickname,channel,oauth);
if (retryCount>1) {
sigIRC.panel.addMessage("SYSTEM: Lost connection. Trying to reconnect...");
System.out.println("SYSTEM: Lost connection. Trying to reconnect...");
}
if (retryCount==0) {
retryCount=1;
} else {
if (System.currentTimeMillis()-60000>lastRetryTime) {
retryCount=0;
} else {
retryCount++;
}
}
lastRetryTime = System.currentTimeMillis();
}
},10000);
}
public static void WriteBreakToLogFile() {
@ -448,7 +544,27 @@ public class sigIRC{
}
}
private static void getSubChannels(String channelName) {
private static void getSubChannels(String s) {
try {
Long id = GetChannelID(s);
subchannelIds.put(id, s);
//System.out.println("Got ID "+id+" for channel "+s);
} catch (JSONException | IOException e) {
e.printStackTrace();
}
//TwitchModule.streamOnline=true;
}
public static Long GetChannelID(String username) throws IOException {
FileUtils.downloadFileFromUrl("https://api.twitch.tv/kraken/users?login="+username, "temp_connect");
JSONObject j = FileUtils.readJsonFromFile("temp_connect");
JSONArray a = j.getJSONArray("users");
Long id = Long.parseLong(a.getJSONObject(0).getString("_id"));
return id;
}
/*private static void getSubChannels(String channelName) {
manager.channels().get(channelName, new ChannelResponseHandler() {
@Override
public void onFailure(Throwable arg0) {
@ -467,23 +583,29 @@ public class sigIRC{
});
//TwitchModule.streamOnline=true;
//return true;
}
}*/
public static void downloadSubEmotes(JSONObject data) {
public static void downloadSubEmotes() {
for (Long l : subchannelIds.keySet()) {
JSONObject channel = data.getJSONObject(Long.toString(l));
JSONArray arr = channel.getJSONArray("emotes");
//System.out.println("Channel: "+channel);
for (int i=0;i<arr.length();i++) {
JSONObject emote = arr.getJSONObject(i);
int id = emote.getInt("id");
String name = emote.getString("code");
//System.out.println("Emote "+(i+1)+" has id "+id+" and code "+name+".");
try {
emoticon_queue.add(new SubEmoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0"), subchannelIds.get(l)));
} catch (MalformedURLException e) {
e.printStackTrace();
JSONObject channel;
try {
channel = FileUtils.readJsonFromUrl("https://api.twitchemotes.com/api/v4/channels/"+l);
//String channel = subchannelIds.get(l);
JSONArray arr = channel.getJSONArray("emotes");
//System.out.println("Channel: "+channel);
for (int i=0;i<arr.length();i++) {
JSONObject emote = arr.getJSONObject(i);
int id = emote.getInt("id");
String name = emote.getString("code");
System.out.println("Emote "+(i+1)+" has id "+id+" and code "+name+".");
try {
emoticon_queue.add(new SubEmoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0"), subchannelIds.get(l)));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
} catch (JSONException | IOException e1) {
e1.printStackTrace();
}
}
//TwitchModule.streamOnline=true;
@ -492,26 +614,30 @@ public class sigIRC{
private static void performTwitchEmoteUpdate() {
try {
JSONObject twitchemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/global.json");
JSONObject twitchemotes = FileUtils.readJsonFromUrl("https://api.twitchemotes.com/api/v4/channels/0"); //Channel 0 is global emotes.
System.out.println("Twitch emote Json read.");
for (String emotes : twitchemotes.keySet()) {
JSONObject emote = twitchemotes.getJSONObject(emotes);
JSONArray emotes = twitchemotes.getJSONArray("emotes");
for (int i=0;i<emotes.length();i++) {
JSONObject emote = emotes.getJSONObject(i);
int id = emote.getInt("id");
String name = emote.getString("code");
emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0")));
System.out.println("Emote "+id+" with name "+name);
if (id>14) {
String name = emote.getString("code");
emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0")));
System.out.println("Emote "+id+" with name "+name);
}
}
//System.out.println("Subscriber object: "+subemotes);
String[] channel_names = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/subscribers.txt");
subchannelCount = channel_names.length;
//System.out.println("Expecting "+subchannelCount+" Channel IDs.");
for (String s : channel_names) {
if (s.length()>0) {
s=s.trim();
//System.out.println("Got sub emote info for "+s);
//TODO Rewrite.
getSubChannels(s);
}
}
//System.out.println("Subscriber object: "+subemotes);
String[] channel_names = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/subscribers.txt");
subchannelCount = channel_names.length;
//System.out.println("Expecting "+subchannelCount+" Channel IDs.");
for (String s : channel_names) {
if (s.length()>0) {
s=s.trim();
//System.out.println("Got sub emote info for "+s);
getSubChannels(s);
}
}
/*JSONObject emotelist = twitchemotes.getJSONObject("emotes");
JSONObject templatelist = twitchemotes.getJSONObject("template");
String templateurl = templatelist.getString("small");
@ -578,8 +704,10 @@ public class sigIRC{
authenticated=true;
} else
if (MessageIsAllowed(line)) {
line = new String(line.getBytes(),"UTF-8");
String filteredMessage = FilterMessage(line);
panel.addMessage(filteredMessage);
}
}
}
@ -587,13 +715,17 @@ public class sigIRC{
private static String FilterMessage(String line) {
final String hostcutoff_str = "sigonitori :";
System.out.println("Original Message: "+line);
String username = line.substring(1, line.indexOf("!"));
String cutstring = channel+" :";
String message = line.substring(line.indexOf(cutstring)+cutstring.length(), line.length());
if (username.equalsIgnoreCase("jtv")) {
message = line.substring(line.indexOf(hostcutoff_str)+hostcutoff_str.length(), line.length());
}
/*if (message.length()>0) {
//message = "\uac00\uac01\uac02\u1100\u1101\u1102\u1117 1234567890 ";
System.out.println(message);
}*/
System.out.println(username+": "+ message);
return username+": "+ message;
}
@ -633,6 +765,7 @@ public class sigIRC{
f.setIconImage(programIcon);
button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
modulebutton = new ModuleSelectorButton(new File(sigIRC.BASEDIR+"modules.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
if (sigIRC.overlayMode) {
f.setBackground(new Color(0,0,0,0));
f.setAlwaysOnTop(true);

@ -21,37 +21,49 @@ import sig.MyPanel;
public class DrawUtils {
public static void drawOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) {
drawOutlineText(g,font,x,y,0,0,outline_size,text_color,shadow_color,message);
drawOutlineText(g,font,x,y,0,0,1,outline_size,text_color,shadow_color,message);
}
static void drawOutlineText(Graphics g, Font font, double x, double y, double xoffset, double yoffset, int outline_size, Color text_color, Color shadow_color, String message) {
AttributedString as = new AttributedString(message);
as.addAttribute(TextAttribute.FONT, font);
g.setColor(shadow_color);
Graphics2D g2 = (Graphics2D) g;
if (message.length()>200) {
g2.setColor(shadow_color);
g2.drawString(as.getIterator(),(int)(x+outline_size+xoffset),(int)(y+outline_size+yoffset));
} else {
public static void drawOutlineText(Graphics g, Font font, double x, double y, int font_thickness, int outline_thickness, Color text_color, Color shadow_color, String message) {
drawOutlineText(g,font,x,y,0,0,font_thickness,outline_thickness,text_color,shadow_color,message);
}
static void drawOutlineText(Graphics g, Font font, double x, double y, double xoffset, double yoffset, int font_thickness, int outline_thickness, Color text_color, Color shadow_color, String message) {
if (message.length()>0) {
AttributedString as = new AttributedString(message);
as.addAttribute(TextAttribute.FONT, font);
as.addAttribute(TextAttribute.KERNING,TextAttribute.KERNING_ON);
as.addAttribute(TextAttribute.WIDTH,TextAttribute.WIDTH_EXTENDED);
as.addAttribute(TextAttribute.TRACKING,0.5);
g.setColor(shadow_color);
Graphics2D g2 = (Graphics2D) g;
FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext();
GlyphVector gv = font.createGlyphVector(frc, message);
Rectangle2D box = gv.getVisualBounds();
Shape shape = gv.getOutline((int)(x+xoffset),(int)(y+yoffset));
g2.setClip(shape);
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset));
g2.setClip(null);
g2.setStroke(new BasicStroke(outline_size*2));
g2.setStroke(new BasicStroke(font_thickness + outline_thickness*2));
g2.setColor(shadow_color);
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.draw(shape);
GlyphVector gv2 = font.createGlyphVector(frc, message);
Shape shape2 = gv2.getOutline((int)(x+xoffset),(int)(y+yoffset));
g2.setClip(null);
g2.setStroke(new BasicStroke(font_thickness));
g2.setColor(text_color);
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.draw(shape2);
g2.setColor(text_color);
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset));
}
g2.setColor(text_color);
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset));
}
public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) {
public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int font_size, int outline_size, Color text_color, Color shadow_color, String message) {
Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(message, font);
drawOutlineText(g,font,x,y,-textBounds.getWidth()/2,-textBounds.getHeight()/2,outline_size,text_color,shadow_color,message);
drawOutlineText(g,font,x,y,-textBounds.getWidth()/2,-textBounds.getHeight()/2,font_size,outline_size,text_color,shadow_color,message);
}
public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) {
drawCenteredOutlineText(g,font,x,y,1,outline_size,text_color,shadow_color,message);
}
public static void drawText(Graphics g, double x, double y, Color color, String message) {
if (message.length()>0) {

@ -8,11 +8,19 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -22,6 +30,7 @@ import org.json.JSONException;
import org.json.JSONObject;
import sig.sigIRC;
import sig.modules.RabiRaceModule;
import sig.modules.ChatLog.ChatLogMessage;
public class FileUtils {
@ -237,9 +246,14 @@ public class FileUtils {
}
public static void logToFile(String message, String filename) {
logToFile(message,filename,false);
if ((!filename.equalsIgnoreCase("debug.log") &&
!filename.equalsIgnoreCase("debug2.log")) || (filename.equalsIgnoreCase("debug.log") && RabiRaceModule.DEBUGMODE==1)
||
(filename.equalsIgnoreCase("debug2.log") && RabiRaceModule.DEBUGMODE==2)
) {
logToFile(message,filename,false);
}
}
public static void logToFile(String message, String filename, boolean outputToChatLog) {
File file = new File(filename);
try {
@ -247,9 +261,9 @@ public class FileUtils {
if (!file.exists()) {
file.createNewFile();
}
FileWriter fw = new FileWriter(file, true);
PrintWriter pw = new PrintWriter(fw);
OutputStream out = new FileOutputStream(file,true);
Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
PrintWriter pw = new PrintWriter(writer);
pw.println(message);
pw.flush();
@ -302,4 +316,36 @@ public class FileUtils {
file.delete();
}
}
public static void downloadFileFromUrl(String url, String file,boolean bearer) throws IOException, JSONException {
File filer = new File(file);
filer.createNewFile();
URL website = new URL(url);
HttpURLConnection connection = (HttpURLConnection) website.openConnection();
/*for (String s : connection.getHeaderFields().keySet()) {
System.out.println(s+": "+connection.getHeaderFields().get(s));
}*/
connection.setRequestMethod("GET");
//connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/vnd.twitchtv.v5+json");
connection.setRequestProperty("Authorization", ((bearer)?"Bearer":"OAuth") + " "+sigIRC.oauth.replace("oauth:", ""));
if (sigIRC.CLIENTID.length()!=0) {
connection.setRequestProperty("Client-ID", sigIRC.CLIENTID);
//System.out.println("Using "+ sigIRC.oauth+"/"+sigIRC.CLIENTID);
}
try {
ReadableByteChannel rbc = Channels.newChannel(connection.getInputStream());
FileOutputStream fos = new FileOutputStream(file);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
} catch (ConnectException e) {
System.out.println("Failed to connect, moving on...");
}
}
public static void downloadFileFromUrl(String url, String file) throws IOException, JSONException {
downloadFileFromUrl(url,file,false); //Uses OAUTH instead of Bearer
}
}

@ -33,7 +33,11 @@ public class TextUtils {
public static boolean isNumeric(String str)
{
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
if (str.length()>0) {
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
} else {
return false;
}
}
public static boolean isInteger(String s, int radix) {

1
tmp

@ -0,0 +1 @@
0
Loading…
Cancel
Save