Compare commits

...

71 Commits

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
  1. 1
      .classpath
  2. 9
      .gitignore
  3. 1
      .settings/org.eclipse.core.resources.prefs
  4. 100
      .settings/org.eclipse.jdt.core.prefs
  5. 0
      sessions
  6. BIN
      sigIRCv2.jar
  7. 2
      src/sig/FileManager.java
  8. 43
      src/sig/Module.java
  9. 10
      src/sig/ModuleLinker.java
  10. 208
      src/sig/ModuleSelector.java
  11. 50
      src/sig/ModuleSelectorButton.java
  12. 43
      src/sig/MyPanel.java
  13. 7
      src/sig/SubEmoticon.java
  14. 13
      src/sig/UpdateEvent.java
  15. 140
      src/sig/modules/BandoriModule.java
  16. 21
      src/sig/modules/ChatLogModule.java
  17. 213
      src/sig/modules/ControllerModule.java
  18. 21
      src/sig/modules/DDRStepModule.java
  19. 10
      src/sig/modules/MapPoint.java
  20. 81
      src/sig/modules/RabiRace/ColorLocation.java
  21. 3
      src/sig/modules/RabiRace/JoinButton.java
  22. 26
      src/sig/modules/RabiRace/MarkMapButton.java
  23. 318
      src/sig/modules/RabiRace/Profile.java
  24. 53
      src/sig/modules/RabiRace/Session.java
  25. 47
      src/sig/modules/RabiRace/SessionCreateWindow.java
  26. 4
      src/sig/modules/RabiRace/SessionListWindow.java
  27. 488
      src/sig/modules/RabiRaceModule.java
  28. 276
      src/sig/modules/RabiRibi/MemoryOffset.java
  29. 21
      src/sig/modules/RabiRibiModule.java
  30. 20
      src/sig/modules/TouhouMotherModule.java
  31. 28
      src/sig/modules/Twitch/Announcement.java
  32. 47
      src/sig/modules/Twitch/Follower.java
  33. 274
      src/sig/modules/TwitchModule.java
  34. 180
      src/sig/sigIRC.java
  35. 10
      src/sig/utils/DrawUtils.java
  36. 56
      src/sig/utils/FileUtils.java
  37. 18
      tmp_profile

@ -4,7 +4,6 @@
<classpathentry kind="src" path="lib"/> <classpathentry kind="src" path="lib"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <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/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="lib/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw.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-linux.jar"/>
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-macos.jar"/> <classpathentry kind="lib" path="lib/lwjgl-glfw-natives-macos.jar"/>

9
.gitignore vendored

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

@ -1,3 +1,4 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/sig/modules/RabiRace/SessionCreateWindow.java=UTF-8 encoding//src/sig/modules/RabiRace/SessionCreateWindow.java=UTF-8
encoding//src/sig/modules/RabiRace/SessionListWindow.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 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.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 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.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=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.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.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 org.eclipse.jdt.core.compiler.source=1.8

Binary file not shown.

@ -9,7 +9,7 @@ import sig.utils.DebugUtils;
public class FileManager { public class FileManager {
String fileloc; String fileloc;
final String serverURL = "http://45.33.13.215/sigIRCv2/"; final String serverURL = "http://45.33.13.215:8080/sigIRCv2/";
boolean folder=false; boolean folder=false;
public FileManager(String location) { public FileManager(String location) {

@ -53,7 +53,7 @@ public class Module {
} }
private void enableWindowDrag(int mouseX, int mouseY) { 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. //Enable dragging.
dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY); dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY);
dragging=DRAGGING=true; dragging=DRAGGING=true;
@ -102,23 +102,32 @@ public class Module {
} }
} }
} }
public static void loadModule() {
}
public static void unloadModule() {
}
private void dragWindow() { private void dragWindow() {
if (dragging) { if (sigIRC.showWindowControls) {
//sigIRC.panel.repaint(getDrawBounds().getBounds()); if (dragging) {
int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX(); //sigIRC.panel.repaint(getDrawBounds().getBounds());
int mouseY = sigIRC.panel.lastMouseY+(int)dragOffset.getY(); int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX();
int oldX = (int)position.getX(); int mouseY = sigIRC.panel.lastMouseY+(int)dragOffset.getY();
int oldY = (int)position.getY(); int oldX = (int)position.getX();
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()); int oldY = (int)position.getY();
//System.out.println(sigIRC.panel.lastMouseX+","+sigIRC.panel.lastMouseY); 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());
ModuleDragEvent(oldX,oldY,mouseX,mouseY); //System.out.println(sigIRC.panel.lastMouseX+","+sigIRC.panel.lastMouseY);
} ModuleDragEvent(oldX,oldY,mouseX,mouseY);
if (inDragBounds(sigIRC.panel.lastMouseX,sigIRC.panel.lastMouseY)) { }
inDragZone=true; if (inDragBounds(sigIRC.panel.lastMouseX,sigIRC.panel.lastMouseY)) {
//System.out.println("In Drag Zone for Module "+name); inDragZone=true;
//sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR)); //System.out.println("In Drag Zone for Module "+name);
} /*else //sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
}
}/*else
if (sigIRC.panel.getCursor().getType()==Cursor.MOVE_CURSOR) { if (sigIRC.panel.getCursor().getType()==Cursor.MOVE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}*/ }*/
@ -141,7 +150,7 @@ public class Module {
} }
private void drawModuleHeader(Graphics g) { private void drawModuleHeader(Graphics g) {
if (!sigIRC.overlayMode) { if (sigIRC.showWindowControls) {
g.drawImage(Module.IMG_DRAGBAR, g.drawImage(Module.IMG_DRAGBAR,
(int)position.getX()+2, (int)position.getX()+2,
(int)position.getY()-Module.IMG_DRAGBAR.getHeight(), (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.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.awt.MouseInfo; import java.awt.MouseInfo;
@ -24,7 +25,11 @@ import java.awt.event.WindowEvent;
import java.awt.event.WindowListener; import java.awt.event.WindowListener;
import java.io.File; import java.io.File;
import java.io.IOException; 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.JColorChooser;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -33,7 +38,9 @@ import javax.swing.JPopupMenu;
import sig.modules.BandoriModule; import sig.modules.BandoriModule;
import sig.modules.ChatLogModule; import sig.modules.ChatLogModule;
import sig.modules.ChatLog.ChatLogMessage; import sig.modules.ChatLog.ChatLogMessage;
import sig.utils.DrawUtils;
import sig.utils.FileUtils; import sig.utils.FileUtils;
import sig.utils.TextUtils;
public class MyPanel extends JPanel implements MouseListener, ActionListener, MouseWheelListener, KeyListener, ComponentListener, WindowListener{ public class MyPanel extends JPanel implements MouseListener, ActionListener, MouseWheelListener, KeyListener, ComponentListener, WindowListener{
//List<String> messages = new ArrayList<String>(); //List<String> messages = new ArrayList<String>();
@ -49,6 +56,13 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
programFont = programFont.deriveFont(sigIRC.messageFontSize); programFont = programFont.deriveFont(sigIRC.messageFontSize);
userFont = userFont.deriveFont(sigIRC.usernameFontSize); userFont = userFont.deriveFont(sigIRC.usernameFontSize);
smallFont = smallFont.deriveFont(sigIRC.touhoumotherConsoleFontSize); 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)); //setBorder(BorderFactory.createLineBorder(Color.black));
addMouseListener(this); addMouseListener(this);
addMouseWheelListener(this); addMouseWheelListener(this);
@ -65,10 +79,14 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
super.paintComponent(g); super.paintComponent(g);
// Draw Text // Draw Text
//int counter=18; //int counter=18;
if (sigIRC.panel!=null) { try {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX()); if (sigIRC.panel!=null && MouseInfo.getPointerInfo()!=null) {
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY()); lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
//System.out.println("("+lastMouseX+","+lastMouseY+")"); 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) { /*if (sigIRC.window!=null && sigIRC.window.getMousePosition(true)!=null && sigIRC.overlayMode) {
lastMouseX = (int)sigIRC.window.getMousePosition(true).getX(); lastMouseX = (int)sigIRC.window.getMousePosition(true).getX();
@ -79,6 +97,12 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
lastMouseY = -1; 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) { for (Module m : sigIRC.modules) {
m.draw(g); m.draw(g);
} }
@ -87,6 +111,11 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
sigIRC.chatlogtwitchemoticons.get(i).draw(g); 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++) { for (int i=0;i<sigIRC.textobj.size();i++) {
if (sigIRC.textobj.get(i).isActive()) { if (sigIRC.textobj.get(i).isActive()) {
if (sigIRC.overlayMode) { if (sigIRC.overlayMode) {
@ -112,6 +141,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
} }
if (!sigIRC.overlayMode) { if (!sigIRC.overlayMode) {
sigIRC.button.draw(g); sigIRC.button.draw(g);
sigIRC.modulebutton.draw(g);
} }
} }
@ -140,6 +170,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
m.mouseModuleMousePress(ev); m.mouseModuleMousePress(ev);
} }
sigIRC.button.onClickEvent(ev); sigIRC.button.onClickEvent(ev);
sigIRC.modulebutton.onClickEvent(ev);
} }
@Override @Override
@ -205,8 +236,10 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
sigIRC.config.setInteger("windowY", sigIRC.windowY); sigIRC.config.setInteger("windowY", sigIRC.windowY);
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth); sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight); 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.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(); //com.repaint();
//sigIRC.panel.repaint(); //sigIRC.panel.repaint();
sigIRC.config.saveProperties(); sigIRC.config.saveProperties();

@ -2,13 +2,6 @@ package sig;
import java.net.URL; 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{ public class SubEmoticon extends Emoticon{
String channelName = ""; String channelName = "";
static boolean userCanUseEmoticon=false; static boolean userCanUseEmoticon=false;

@ -38,8 +38,8 @@ public class UpdateEvent implements ActionListener{
sigIRC.subchannelCount==sigIRC.subchannelIds.size()) { sigIRC.subchannelCount==sigIRC.subchannelIds.size()) {
Thread downloadThread = new Thread(){ Thread downloadThread = new Thread(){
public void run() { public void run() {
JSONObject data = GetSubEmoteJson(); //JSONObject data = GetSubEmoteJson();
sigIRC.downloadSubEmotes(data); sigIRC.downloadSubEmotes();
sigIRC.subEmotesCompleted=true; sigIRC.subEmotesCompleted=true;
} }
}; };
@ -48,8 +48,8 @@ public class UpdateEvent implements ActionListener{
} }
} }
private JSONObject GetSubEmoteJson() { private boolean GetSubEmotesNeedChecking() {
JSONObject subemotes = null; /*JSONObject subemotes = null;
try { try {
File filer = new File(sigIRC.SUBEMOTELISTFILE); File filer = new File(sigIRC.SUBEMOTELISTFILE);
if (!filer.exists()) { if (!filer.exists()) {
@ -77,10 +77,11 @@ public class UpdateEvent implements ActionListener{
} }
} catch (JSONException | IOException e) { } catch (JSONException | IOException e) {
e.printStackTrace(); e.printStackTrace();
} }*/
boolean needsUpdate = sigIRC.lastSubEmoteUpdate != Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
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); sigIRC.config.setInteger("lastSubEmote_APIUpdate", sigIRC.lastSubEmoteUpdate);
return subemotes; return needsUpdate;
} }
private void UpdateWindowPosition() { private void UpdateWindowPosition() {

@ -2,6 +2,7 @@ package sig.modules;
import java.awt.Color; import java.awt.Color;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@ -28,7 +29,8 @@ import sig.utils.SoundUtils;
public class BandoriModule extends Module{ public class BandoriModule extends Module{
public static BandoriModule bandori_module; public static BandoriModule bandori_module;
public BufferedImage stamp_collection1,stamp_collection2; 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,ImageScheme> image_map = new HashMap<String,ImageScheme>();
public static HashMap<String,List<String>> stamp_map = new HashMap<String,List<String>>(); public static HashMap<String,List<String>> stamp_map = new HashMap<String,List<String>>();
static List<Stamp> active_stamps = new ArrayList<Stamp>(); static List<Stamp> active_stamps = new ArrayList<Stamp>();
@ -52,6 +54,15 @@ public class BandoriModule extends Module{
try { try {
stamp_collection1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps1.png")); stamp_collection1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps1.png"));
stamp_collection2 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps2_2.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) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -81,6 +92,7 @@ public class BandoriModule extends Module{
image_map.put("ako_onemoretime", new ImageScheme(stamp_collection1,23)); image_map.put("ako_onemoretime", new ImageScheme(stamp_collection1,23));
image_map.put("rinko_jam", new ImageScheme(stamp_collection2,0)); 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("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("kokoro_moremore", new ImageScheme(stamp_collection2,3));
image_map.put("arisa_huh", new ImageScheme(stamp_collection2,4)); image_map.put("arisa_huh", new ImageScheme(stamp_collection2,4));
image_map.put("yukina_followmylead", new ImageScheme(stamp_collection2,5)); image_map.put("yukina_followmylead", new ImageScheme(stamp_collection2,5));
@ -110,15 +122,35 @@ public class BandoriModule extends Module{
image_map.put("arisa_okayhereigo", new ImageScheme(stamp_collection2,29)); image_map.put("arisa_okayhereigo", new ImageScheme(stamp_collection2,29));
image_map.put("tomoe_giveityourall", new ImageScheme(stamp_collection2,30)); image_map.put("tomoe_giveityourall", new ImageScheme(stamp_collection2,30));
image_map.put("kanon_keepgoing", new ImageScheme(stamp_collection2,31)); 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("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("tae_letsplay",Arrays.asList("playtogether","wanttoplay","multilive","letsplay"));
stamp_map.put("rimi_choco",Arrays.asList("choco","cornet")); stamp_map.put("rimi_choco",Arrays.asList("choco","cornet"));
stamp_map.put("saya_bread",Arrays.asList("bread")); stamp_map.put("saya_bread",Arrays.asList("bread"));
stamp_map.put("arisa_doki",Arrays.asList("doki","chomama","baka")); stamp_map.put("arisa_doki",Arrays.asList("doki","chomama","baka"));
stamp_map.put("ran_same",Arrays.asList("sameasalways","alwayssame","alwaysthesame","itsum")); 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("moca_youdidit",Arrays.asList("youdidit","congratulations","buns","mocatastic"));
stamp_map.put("himari_heyheyhoh",Arrays.asList("heyo","heyhey","hihi","hiyo")); stamp_map.put("himari_heyheyhoh",Arrays.asList("heyo","heyhey","hihi","hiyo","aao"));
stamp_map.put("tomoe_letsdothis",Arrays.asList("letsdothis","letsdoit")); stamp_map.put("tomoe_letsdothis",Arrays.asList("letsdothis","letsdoit"));
stamp_map.put("tsugumi_wecandoit",Arrays.asList("wegotthis","wegotit","wecan")); stamp_map.put("tsugumi_wecandoit",Arrays.asList("wegotthis","wegotit","wecan"));
stamp_map.put("kokoro_happylucky",Arrays.asList("happy!","lucky")); stamp_map.put("kokoro_happylucky",Arrays.asList("happy!","lucky"));
@ -126,8 +158,8 @@ public class BandoriModule extends Module{
stamp_map.put("aya_fever",Arrays.asList("fever","ayay")); stamp_map.put("aya_fever",Arrays.asList("fever","ayay"));
stamp_map.put("hagumi_smileyay",Arrays.asList("smileyay","yay!")); stamp_map.put("hagumi_smileyay",Arrays.asList("smileyay","yay!"));
stamp_map.put("kanon_fuee",Arrays.asList("fuu","fue","waa","reee")); stamp_map.put("kanon_fuee",Arrays.asList("fuu","fue","waa","reee"));
stamp_map.put("misaki_ready",Arrays.asList("amready","beenready","ready!")); stamp_map.put("misaki_ready",Arrays.asList("ready"));
stamp_map.put("hina_fullcombo",Arrays.asList("fcd","fullcombo","nomiss","allperfect","notasinglemiss","thefc","anfc","fullperfect","easyfc","ezfc")); 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("chisato_planned",Arrays.asList("justasplanned","allplanned","calculated","thatcoming"));
stamp_map.put("maya_huhehe",Arrays.asList("hehe","huehe","huehue","shuwashuwa")); stamp_map.put("maya_huhehe",Arrays.asList("hehe","huehe","huehue","shuwashuwa"));
stamp_map.put("eve_bushido",Arrays.asList("bushido")); stamp_map.put("eve_bushido",Arrays.asList("bushido"));
@ -166,6 +198,25 @@ public class BandoriModule extends Module{
stamp_map.put("arisa_okayhereigo",Arrays.asList("hereigo","okayilltry","alrightilltry","domybest","trymybest","alrighty","itashot","myturn","domybest")); 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("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("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()) { /*for (String s : image_map.keySet()) {
ImageScheme scheme = image_map.get(s); ImageScheme scheme = image_map.get(s);
@ -181,6 +232,26 @@ public class BandoriModule extends Module{
} }
} }
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 { public BufferedImage crop(BufferedImage img, int x, int y, int targetWidth, int targetHeight) throws IOException {
int height = img.getHeight(); int height = img.getHeight();
int width = img.getWidth(); int width = img.getWidth();
@ -219,8 +290,18 @@ public class BandoriModule extends Module{
for (String message_search : stamp_map.get(key)) { for (String message_search : stamp_map.get(key)) {
String filteredmessage = message; String filteredmessage = message;
filteredmessage = filteredmessage.replaceAll("[^A-Za-z0-9]",""); 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); //System.out.println(filteredmessage);
if (message_search.contains("?") || message_search.contains("!")) { if (message_search.contains("?") || message_search.contains("!")
|| message_search.contains(".") || message_search.contains(":")) {
if (message.contains(message_search)) { if (message.contains(message_search)) {
foundmatch = true; foundmatch = true;
CreateStamp(key); CreateStamp(key);
@ -264,25 +345,32 @@ public class BandoriModule extends Module{
public void draw(Graphics g) { public void draw(Graphics g) {
super.draw(g); super.draw(g);
for (Stamp s : active_stamps) { if (sigIRC.panel!=null) {
//Stamp is 130x107 pixels for (Stamp s : active_stamps) {
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, //Stamp is 130x107 pixels
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); 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,
Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()+24); s.scheme.base.getWidth(),s.scheme.base.getHeight(),sigIRC.panel);
double successChance = 1; } else {
DecimalFormat df = new DecimalFormat("0"); 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,
DecimalFormat df2 = new DecimalFormat("0.0"); 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);
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); Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()+24);
if (s.getTotal()!=0) { double successChance = 1;
double successRate = (double)s.getSuccesses()/s.getTotal(); DecimalFormat df = new DecimalFormat("0");
successChance *= successRate; DecimalFormat df2 = new DecimalFormat("0.0");
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()-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)+"%");
} }
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) { public void keypressed(KeyEvent ev) {
@ -383,4 +471,12 @@ class ImageScheme{
this.base=base; this.base=base;
this.stamp_index=index; 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.Color;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelEvent;
import java.awt.geom.Rectangle2D; 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() { public void run() {
super.run(); super.run();
if (delay>0 && sigIRC.subEmotesCompleted) { if (delay>0 && sigIRC.subEmotesCompleted) {

@ -103,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)); //buttons.add(new Button(0.1,0.05,0.1,0.05,controllers.get(0),Identifier.Button._3,Color.RED,this));
LoadButtonAndAxisData(); 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() { public List<Controller> getControllers() {
@ -382,106 +405,108 @@ public class ControllerModule extends Module{
public void run() { public void run() {
Point mouse_position = new Point((int)(sigIRC.panel.lastMouseX-getPosition().getX()),(int)(sigIRC.panel.lastMouseY-getPosition().getY())); Point mouse_position = new Point((int)(sigIRC.panel.lastMouseX-getPosition().getX()),(int)(sigIRC.panel.lastMouseY-getPosition().getY()));
if (resizing) { if (sigIRC.showWindowControls) {
PerformResize(mouse_position); if (resizing) {
setConstraints(); 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 (dragging) {
if (selectedElement!=null && extendBoundaries(selectedElement.getPixelBounds(controller_img),3).contains(mouse_position)) { selectedElement.setBounds(new Rectangle2D.Double((mouse_position.getX()+xoffset)/controller_img.getWidth(sigIRC.panel),
if (!resizing) { (mouse_position.getY()+yoffset)/controller_img.getHeight(sigIRC.panel),
resizing_direction=0; selectedElement.getBounds().getWidth(),
if (mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()<=RESIZE_BORDER && selectedElement.getBounds().getHeight()));
mouse_position.getY()-selectedElement.getPixelBounds(controller_img).getY()>=-RESIZE_BORDER) { setConstraints();
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) { if (!inDragZone && selectedElement==null) {
case 1:{ if (findMouseoverElement(mouse_position)!=null) {
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(); int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.NE_RESIZE_CURSOR) { if (cursortype!=Cursor.HAND_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR)); sigIRC.panel.setCursor(new Cursor(Cursor.HAND_CURSOR));
} }
}break; } else {
case 6:{
int cursortype = sigIRC.panel.getCursor().getType(); int cursortype = sigIRC.panel.getCursor().getType();
if (cursortype!=Cursor.SE_RESIZE_CURSOR) { if (cursortype!=Cursor.DEFAULT_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) { !inDragZone) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 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) { for (Controller c : controllers) {

@ -4,6 +4,7 @@ import java.awt.Color;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Image; import java.awt.Image;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.io.File; import java.io.File;
@ -82,6 +83,26 @@ public class DDRStepModule extends Module{
} }
} }
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() { public void run() {
super.run(); super.run();

@ -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) { if (RabiRaceModule.mySession==null) {
RabiRaceModule.module.window.setVisible(true); RabiRaceModule.module.window.setVisible(true);
} else { } else {
//RabiRaceModule.module.LeaveSession();
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data"); File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try { 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; RabiRaceModule.mySession=null;
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); 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();
}
}
}

@ -5,6 +5,7 @@ import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Point; import java.awt.Point;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -23,24 +24,28 @@ import java.util.Random;
import sig.ScrollingText; import sig.ScrollingText;
import sig.sigIRC; import sig.sigIRC;
import sig.modules.RabiRaceModule; import sig.modules.RabiRaceModule;
import sig.modules.RabiRibi.MemoryOffset;
import sig.utils.DrawUtils; import sig.utils.DrawUtils;
import sig.utils.FileUtils; import sig.utils.FileUtils;
import sig.utils.TextUtils; import sig.utils.TextUtils;
public class Profile { public class Profile {
public static final int EVENT_COUNT = 265;
public String username = sigIRC.nickname.toLowerCase(); public String username = sigIRC.nickname.toLowerCase();
public String displayName = sigIRC.nickname; public String displayName = sigIRC.nickname;
public Avatar avatar; public Avatar avatar;
public int playtime = 0; public int playtime = 0;
public int healthUps = 0; public String healthUps = "0000000000000000000000000000000000000000000000000000000000000000";
public int attackUps = 0; public String attackUps = "0000000000000000000000000000000000000000000000000000000000000000";
public int manaUps = 0; public String manaUps = "0000000000000000000000000000000000000000000000000000000000000000";
public int regenUps = 0; public String regenUps = "0000000000000000000000000000000000000000000000000000000000000000";
public int packUps = 0; public String packUps = "0000000000000000000000000000000000000000000000000000000000000000";
public int rainbowEggCount = 0; 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 boolean isPaused = false;
public int difficulty = 0; public int difficulty = 0;
public int loop = 0; public int loop = 0;
public int map = 0; //Map color.
public float itempct = 0; public float itempct = 0;
public float mappct = 0; public float mappct = 0;
public LinkedHashMap<MemoryData,Integer> key_items = new LinkedHashMap<MemoryData,Integer>(); public LinkedHashMap<MemoryData,Integer> key_items = new LinkedHashMap<MemoryData,Integer>();
@ -56,6 +61,8 @@ public class Profile {
public Image imageDisplayUpdateImage; public Image imageDisplayUpdateImage;
public boolean stat_update_required = true; public boolean stat_update_required = true;
public boolean image_display_update_required = true; public boolean image_display_update_required = true;
public int timeKey = -1;
public boolean syncing = false;
public Profile(RabiRaceModule module) { public Profile(RabiRaceModule module) {
this(module,true); this(module,true);
@ -79,7 +86,7 @@ public class Profile {
oldProfile.manaUps = manaUps; oldProfile.manaUps = manaUps;
oldProfile.regenUps = regenUps; oldProfile.regenUps = regenUps;
oldProfile.packUps = packUps; oldProfile.packUps = packUps;
oldProfile.rainbowEggCount = rainbowEggCount; oldProfile.rainbowEggs = rainbowEggs;
oldProfile.key_items = (LinkedHashMap<MemoryData, Integer>)key_items.clone(); oldProfile.key_items = (LinkedHashMap<MemoryData, Integer>)key_items.clone();
oldProfile.badges = (LinkedHashMap<MemoryData, Integer>)badges.clone(); oldProfile.badges = (LinkedHashMap<MemoryData, Integer>)badges.clone();
oldProfile.playtime = playtime; oldProfile.playtime = playtime;
@ -102,7 +109,7 @@ public class Profile {
if (oldProfile.packUps!=packUps) { if (oldProfile.packUps!=packUps) {
count++; count++;
} }
if (oldProfile.rainbowEggCount!=rainbowEggCount) { if (oldProfile.rainbowEggs!=rainbowEggs) {
count++; count++;
} }
for (MemoryData md : key_items.keySet()) { for (MemoryData md : key_items.keySet()) {
@ -128,6 +135,76 @@ public class Profile {
return count; 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() { public void compareAndAnnounceAllChangedValues() {
//System.out.println(oldProfile.key_items.get(MemoryData.HAMMER)+","+key_items.get(MemoryData.HAMMER)); //System.out.println(oldProfile.key_items.get(MemoryData.HAMMER)+","+key_items.get(MemoryData.HAMMER));
int changedValueCount = compareAllChangedValues(); int changedValueCount = compareAllChangedValues();
@ -135,45 +212,52 @@ public class Profile {
return; return;
} }
String announcement = ""; String announcement = "";
if (oldProfile.healthUps==healthUps-1) { if (GetHealthUpCount(oldProfile)==GetHealthUpCount(this)-1) {
announcement = "has obtained a Health Up! ("+healthUps+" total)"; announcement = "has obtained a Health Up! ("+GetHealthUpCount(this)+" total)";
MarkCurrentPosition();
} }
if (oldProfile.attackUps==attackUps-1) { if (GetAttackUpCount(oldProfile)==GetAttackUpCount(this)-1) {
announcement = "has obtained an Attack Up! ("+attackUps+" total)"; announcement = "has obtained an Attack Up! ("+GetAttackUpCount(this)+" total)";
MarkCurrentPosition();
} }
if (oldProfile.manaUps==manaUps-1) { if (GetManaUpCount(oldProfile)==GetManaUpCount(this)-1) {
announcement = "has obtained a Mana Up! ("+manaUps+" total)"; announcement = "has obtained a Mana Up! ("+GetManaUpCount(this)+" total)";
MarkCurrentPosition();
} }
if (oldProfile.regenUps==regenUps-1) { if (GetRegenUpCount(oldProfile)==GetRegenUpCount(this)-1) {
announcement = "has obtained a Regen Up! ("+regenUps+" total)"; announcement = "has obtained a Regen Up! ("+GetRegenUpCount(this)+" total)";
MarkCurrentPosition();
} }
if (oldProfile.packUps==packUps-1) { if (GetPackUpCount(oldProfile)==GetPackUpCount(this)-1) {
announcement = "has obtained a Pack Up! ("+packUps+" total)"; 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 && if (RabiRaceModule.mySession!=null &&
RabiRaceModule.mySession.gamemode==0 && RabiRaceModule.mySession.gamemode==0 &&
RabiRaceModule.mySession.eggCount>0) { RabiRaceModule.mySession.rainbowEggGoal>0) {
if (RabiRaceModule.mySession.eggCount-rainbowEggCount==0) { if (RabiRaceModule.mySession.rainbowEggGoal-GetRainbowEggCount(this)==0) {
announcement = "has obtained "+RabiRaceModule.mySession.eggCount+" Rainbow Eggs! (NAME) has completed the race!"; announcement = "has obtained "+RabiRaceModule.mySession.rainbowEggGoal+" Rainbow Eggs! (NAME) has completed the race!";
} else if (RabiRaceModule.mySession.eggCount-rainbowEggCount>0) } 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 { } else {
announcement = "has obtained a Rainbow Egg! ("+rainbowEggCount+" total)"; announcement = "has obtained a Rainbow Egg! ("+rainbowEggs+" total)";
} }
} }
for (MemoryData md : key_items.keySet()) { for (MemoryData md : key_items.keySet()) {
if (!oldProfile.key_items.containsKey(md) && if (!oldProfile.key_items.containsKey(md) &&
key_items.containsKey(md)) { key_items.containsKey(md)) {
announcement = "has obtained "+md.name+"!"; announcement = "has obtained "+md.name+"!";
MarkCurrentPosition();
} }
} }
for (MemoryData md : badges.keySet()) { for (MemoryData md : badges.keySet()) {
if (!oldProfile.badges.containsKey(md) && if (!oldProfile.badges.containsKey(md) &&
badges.containsKey(md)) { badges.containsKey(md)) {
announcement = "has obtained the "+md.name+" badge!"; announcement = "has obtained the "+md.name+" badge!";
MarkCurrentPosition();
} }
} }
if (announcement.length()>0 && changedValueCount!=0) { if (announcement.length()>0 && changedValueCount!=0) {
@ -187,7 +271,7 @@ public class Profile {
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data"); File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data");
try { 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) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
@ -214,18 +298,104 @@ public class Profile {
badges.remove(md); 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() { public void uploadProfile() {
if (sigIRC.authenticated) { if (sigIRC.authenticated) {
File file = new File(sigIRC.BASEDIR+"tmp"); File file = new File(sigIRC.BASEDIR+"tmp2");
try { 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) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); 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) { if (sigIRC.authenticated) {
File file = new File(sigIRC.BASEDIR+"tmp_profile"); File file = new File(sigIRC.BASEDIR+"tmp_profile");
try { 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) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); 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"); String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"tmp_profile");
//System.out.println(Arrays.toString(data)); //System.out.println(Arrays.toString(data));
if (data.length>=18) { if (data.length>=23) {
int i=0; int i=0;
displayName = data[i++]; displayName = data[i++];
try {
avatar = Avatar.getAvatarFromID(Integer.parseInt(data[i++])); avatar = Avatar.getAvatarFromID(Integer.parseInt(data[i++]));
//System.out.println("Updated Avatar for Player "+displayName+" with Avatar "+avatar.displayName); //System.out.println("Updated Avatar for Player "+displayName+" with Avatar "+avatar.displayName);
timeKey = Integer.parseInt(data[i++]);
playtime = Integer.parseInt(data[i++]); playtime = Integer.parseInt(data[i++]);
healthUps = Integer.parseInt(data[i++]); healthUps = data[i++];
manaUps = Integer.parseInt(data[i++]); manaUps = data[i++];
regenUps = Integer.parseInt(data[i++]); regenUps = data[i++];
packUps = Integer.parseInt(data[i++]); packUps = data[i++];
attackUps = Integer.parseInt(data[i++]); attackUps = data[i++];
rainbowEggCount = Integer.parseInt(data[i++]); rainbowEggs = Integer.parseInt(data[i++]);
isPaused = Boolean.parseBoolean(data[i++]); isPaused = Boolean.parseBoolean(data[i++]);
difficulty = Integer.parseInt(data[i++]); difficulty = Integer.parseInt(data[i++]);
loop = Integer.parseInt(data[i++]); loop = Integer.parseInt(data[i++]);
itempct = Float.parseFloat(data[i++]); itempct = Float.parseFloat(data[i++]);
mappct = Float.parseFloat(data[i++]); mappct = Float.parseFloat(data[i++]);
} catch (NumberFormatException e) {
return false;
}
i+=2; i+=2;
String nextval = data[i++]; String nextval = data[i++];
if (!nextval.equalsIgnoreCase("BADGES:")) { if (!nextval.equalsIgnoreCase("BADGES:")) {
@ -279,7 +455,16 @@ public class Profile {
} }
while (!nextval.equalsIgnoreCase("UPDATES:")); 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(); lastWebUpdate = System.currentTimeMillis();
FileUtils.logToFile("["+System.currentTimeMillis()+"]Sync completed syccessfully.", "debug.log");
return true; return true;
} }
} }
@ -290,13 +475,14 @@ public class Profile {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
appendData(sigIRC.nickname,sb); appendData(sigIRC.nickname,sb);
appendData(avatar.value,sb); appendData(avatar.value,sb);
appendData(RabiRaceModule.CLIENT_SERVER_READTIME,sb);
appendData(playtime,sb); appendData(playtime,sb);
appendData(healthUps,sb); appendData(healthUps,sb);
appendData(manaUps,sb); appendData(manaUps,sb);
appendData(regenUps,sb); appendData(regenUps,sb);
appendData(packUps,sb); appendData(packUps,sb);
appendData(attackUps,sb); appendData(attackUps,sb);
appendData(rainbowEggCount,sb); appendData(rainbowEggs,sb);
appendData(isPaused,sb); appendData(isPaused,sb);
appendData(difficulty,sb); appendData(difficulty,sb);
appendData(loop,sb); appendData(loop,sb);
@ -314,6 +500,10 @@ public class Profile {
appendData(data.name()+";"+val,sb); appendData(data.name()+";"+val,sb);
} }
appendData("UPDATES:",sb); appendData("UPDATES:",sb);
appendData(eventStruct,sb);
appendData(map,sb);
appendData(syncing,sb);
appendData("END",sb);
return sb.toString(); return sb.toString();
} }
@ -325,6 +515,7 @@ public class Profile {
} }
public static Avatar GetSeededAvatar(String username) { public static Avatar GetSeededAvatar(String username) {
//System.out.println(RabiRaceModule.mySession.getPlayers());
Random r = new Random(); Random r = new Random();
r.setSeed(username.toLowerCase().hashCode()); r.setSeed(username.toLowerCase().hashCode());
int randomnumb = r.nextInt(28); int randomnumb = r.nextInt(28);
@ -341,18 +532,24 @@ public class Profile {
//g2.fillRect(1, 1, 32, 32); //g2.fillRect(1, 1, 32, 32);
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel); g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel);
g2.setColor(ScrollingText.GetUserNameColor(displayName)); g2.setColor(ScrollingText.GetUserNameColor(displayName));
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName); 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, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName()); DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 0, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
String text = TextUtils.convertSecondsToTimeFormat(playtime/60); String text = TextUtils.convertSecondsToTimeFormat(playtime/60);
if (!syncing) {
g2.setColor(new Color(196,24,24));
} else
if (isPaused) { if (isPaused) {
g2.setColor(new Color(128,96,0)); g2.setColor(new Color(128,96,0));
} else { } else {
g2.setColor(Color.BLACK); 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)+"%"; 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.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); statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
//stat_update_required = false; //stat_update_required = false;
@ -421,17 +618,25 @@ public class Profile {
if (gamemode!=-1) { if (gamemode!=-1) {
switch (gamemode) { switch (gamemode) {
case 0:{ //Egg Hunt. case 0:{ //Egg Hunt.
if (session.eggCount>0) { if (session.rainbowEggGoal>0) {
spacing = width/session.eggCount; spacing = width/session.rainbowEggGoal;
rainbowEggLimit = session.eggCount; rainbowEggLimit = session.rainbowEggGoal;
} else { } else {
spacing = width/5; spacing = width/5;
rainbowEggLimit = session.eggCount; rainbowEggLimit = session.rainbowEggGoal;
} }
Image img = RabiRaceModule.image_map.get("easter_egg.png"); Image img = RabiRaceModule.image_map.get("easter_egg.png");
for (int i=0;i<session.eggCount;i++) { if (rainbowEggLimit>10) {
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192); Color col = RabiRaceModule.rainbowcycler.getCycleColor();
DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel); 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; }break;
case 1:{ //Item Hunt. case 1:{ //Item Hunt.
@ -504,17 +709,18 @@ public class Profile {
RabiRaceModule.image_map.get("pack_up.png"), RabiRaceModule.image_map.get("pack_up.png"),
RabiRaceModule.image_map.get("attack_up.png")}; RabiRaceModule.image_map.get("attack_up.png")};
int[] amts = new int[]{ int[] amts = new int[]{
healthUps, GetHealthUpCount(this),
manaUps, GetManaUpCount(this),
regenUps, GetRegenUpCount(this),
packUps, GetPackUpCount(this),
attackUps, GetAttackUpCount(this),
}; };
if (rainbowEggCount>rainbowEggLimit) { spacing=width/6;
if (GetRainbowEggCount(this)>rainbowEggLimit) {
imgs = Arrays.copyOf(imgs, imgs.length+1); imgs = Arrays.copyOf(imgs, imgs.length+1);
imgs[imgs.length-1] = RabiRaceModule.image_map.get("easter_egg.png"); imgs[imgs.length-1] = RabiRaceModule.image_map.get("easter_egg.png");
amts = Arrays.copyOf(amts, amts.length+1); amts = Arrays.copyOf(amts, amts.length+1);
amts[amts.length-1] = rainbowEggCount; amts[amts.length-1] = GetRainbowEggCount(this);
spacing = width/6; 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); //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 { } else {
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, sigIRC.panel); 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) { } catch (ConcurrentModificationException e) {

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

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

@ -148,7 +148,7 @@ public class SessionListWindow extends JFrame{
hashedPass="none"; hashedPass="none";
} }
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp_session.data"); 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"); String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
if (data.length==1) { if (data.length==1) {
@ -208,6 +208,8 @@ public class SessionListWindow extends JFrame{
} }
count++; count++;
} }
FileUtils.logToFile("["+System.currentTimeMillis()+"]Updated sessions listing.", "debug.log");
//System.out.println("Selected is "+selected); //System.out.println("Selected is "+selected);
//Try to find ID in list. //Try to find ID in list.
} }

@ -5,6 +5,7 @@ import java.awt.Graphics;
import java.awt.Image; import java.awt.Image;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
@ -37,6 +38,7 @@ import sig.modules.RabiRace.ClickableButton;
import sig.modules.RabiRace.ColorCycler; import sig.modules.RabiRace.ColorCycler;
import sig.modules.RabiRace.CreateButton; import sig.modules.RabiRace.CreateButton;
import sig.modules.RabiRace.JoinButton; import sig.modules.RabiRace.JoinButton;
import sig.modules.RabiRace.MarkMapButton;
import sig.modules.RabiRace.MemoryData; import sig.modules.RabiRace.MemoryData;
import sig.modules.RabiRace.Profile; import sig.modules.RabiRace.Profile;
import sig.modules.RabiRace.Session; import sig.modules.RabiRace.Session;
@ -48,34 +50,62 @@ import sig.modules.RabiRibi.MemoryType;
import sig.modules.utils.PsapiTools; import sig.modules.utils.PsapiTools;
import sig.utils.DrawUtils; import sig.utils.DrawUtils;
import sig.utils.FileUtils; import sig.utils.FileUtils;
import sig.utils.SoundUtils;
import sig.utils.TextUtils; import sig.utils.TextUtils;
public class RabiRaceModule extends Module{ 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 ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
final static String AVATAR_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/characters/"; 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; boolean foundRabiRibi = false;
final static int WAITFRAMEMAX = 120;
int waitframes = WAITFRAMEMAX;
int rabiRibiPID = -1; int rabiRibiPID = -1;
long rabiRibiMemOffset = 0; long rabiRibiMemOffset = 0;
public HANDLE rabiribiProcess = null; public HANDLE rabiribiProcess = null;
public static HashMap<String,Image> image_map = new HashMap<String,Image>(); public static HashMap<String,Image> image_map = new HashMap<String,Image>();
public static Image UNKNOWN_ITEM; public static Image UNKNOWN_ITEM;
public static ColorCycler rainbowcycler = new ColorCycler(new Color(255,0,0,96),16); 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 static RabiRaceModule module;
public Profile myProfile = new Profile(this,false);
public static SessionListWindow window; public static SessionListWindow window;
public static SessionCreateWindow createwindow; public static SessionCreateWindow createwindow;
public static AvatarSelectionWindow avatarwindow; public static AvatarSelectionWindow avatarwindow;
public static Session mySession; public static Session mySession;
boolean firstCheck=false; boolean firstCheck=false;
public List<ScrollingText> messages = new ArrayList<ScrollingText>(); public List<ScrollingText> messages = new ArrayList<ScrollingText>();
public List<String> messagequeue = new ArrayList<String>();
public static int lastScrollX = 0; public static int lastScrollX = 0;
boolean firstUpdate=true; boolean firstUpdate=true;
boolean mouseoverAvatar=false; 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(); 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> key_items_list = new ArrayList<MemoryData>();
public static List<MemoryData> badges_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() { private void Initialize() {
File f = new File("debug.log");
f.delete();
f = new File("debug2.log");
f.delete();
CheckRabiRibiClient(); CheckRabiRibiClient();
VerifyClientIsValid(); //If the client is not allowed to send data, we need to know that.
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleWithFixedDelay(()->{ scheduler.scheduleWithFixedDelay(()->{
CheckRabiRibiClient(); RunRabiRace();
if (foundRabiRibi) { }, 1500, 1500, TimeUnit.MILLISECONDS);
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);
myProfile.downloadProfile(); //Synchronize our profile at the beginning. 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(()->{ scheduler2.scheduleWithFixedDelay(()->{
if (foundRabiRibi) { RunRabiRaceUpdater();
UpdateMyProfile();
}
}, 250, 250, TimeUnit.MILLISECONDS); }, 250, 250, TimeUnit.MILLISECONDS);
File dir = new File(ITEMS_DIRECTORY); File dir = new File(ITEMS_DIRECTORY);
@ -158,6 +178,7 @@ public class RabiRaceModule extends Module{
try { try {
UNKNOWN_ITEM = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/rabi-ribi/unknown.png")); 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) { } catch (IOException e) {
e.printStackTrace(); 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); 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); 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) { private void AddImagesToImageMap(File dir, String DIRECTORY) {
@ -191,24 +281,206 @@ public class RabiRaceModule extends Module{
private void getMessageUpdates() { private void getMessageUpdates() {
File file = new File(sigIRC.BASEDIR+"sigIRC/messages"); File file = new File(sigIRC.BASEDIR+"sigIRC/messages");
try { 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) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/messages"); 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) { for (String s : data) {
if (s.length()>0) { if (s.length()>0) {
messages.add(new ScrollingText(s,(int)(lastScrollX+position.getWidth()+24),(int)(position.getHeight()-28))); 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() { public void getSessionList() {
File file = new File(sigIRC.BASEDIR+"sessions"); File file = new File(sigIRC.BASEDIR+"sessions");
try { 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"); String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sessions");
//System.out.println("Data is "+Arrays.toString(data)); //System.out.println("Data is "+Arrays.toString(data));
session_listing.UpdateData(data); session_listing.UpdateData(data);
@ -220,6 +492,7 @@ public class RabiRaceModule extends Module{
} else { } else {
join_button.setButtonLabel("Leave Session"); 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(); window.UpdateSessionList();
} }
@ -230,11 +503,19 @@ public class RabiRaceModule extends Module{
if (firstCheck && mySession==null && create_button.mouseInsideBounds(ev)) { if (firstCheck && mySession==null && create_button.mouseInsideBounds(ev)) {
create_button.onClickEvent(ev); create_button.onClickEvent(ev);
} }
if (firstCheck && markmap_button.mouseInsideBounds(ev)) {
markmap_button.onClickEvent(ev);
}
if (mouseoverAvatar) { if (mouseoverAvatar) {
avatarwindow.setVisible(true); avatarwindow.setVisible(true);
} }
} }
public void mouseWheel(MouseWheelEvent ev) {
selectedMapIcon+=Math.signum(ev.getWheelRotation());
selectedMapIcon=(selectedMapIcon<0)?15:selectedMapIcon%16;
}
private void CheckRabiRibiClient() { private void CheckRabiRibiClient() {
List<Integer> pids; List<Integer> pids;
try { try {
@ -280,8 +561,25 @@ public class RabiRaceModule extends Module{
} }
public void run() { public void run() {
frames++;
if (foundRabiRibi) { 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(); 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) { if (window!=null) {
window.run(); window.run();
} }
@ -290,22 +588,85 @@ public class RabiRaceModule extends Module{
messages.remove(i--); 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) { if (lastScrollX>0) {
lastScrollX-=ScrollingText.SCROLLSPD; 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() { private void UpdateMyProfile() {
if (foundRabiRibi) { if (foundRabiRibi) {
//System.out.println("Called."); //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); 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); //System.out.println(itempct+","+paused);
if (paused==0 && itempct>=0) { if (paused==0 && itempct>=0) {
myProfile.archiveAllValues(); 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.attackUps = readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END);
myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END); myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END);
myProfile.manaUps = readItemCountFromMemory(MemoryOffset.MANAUP_START,MemoryOffset.MANAUP_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.packUps = readItemCountFromMemory(MemoryOffset.PACKUP_START,MemoryOffset.PACKUP_END);
myProfile.itempct = itempct; myProfile.itempct = itempct;
myProfile.mappct = readFloatFromMemory(MemoryOffset.MAP_PERCENT); myProfile.mappct = readFloatFromMemory(MemoryOffset.MAP_PERCENT);
myProfile.playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
myProfile.difficulty = readIntFromMemory(MemoryOffset.GAME_DIFFICULTY); myProfile.difficulty = readIntFromMemory(MemoryOffset.GAME_DIFFICULTY);
myProfile.loop = readIntFromMemory(MemoryOffset.GAME_LOOP); myProfile.loop = readIntFromMemory(MemoryOffset.GAME_LOOP);
myProfile.map = readIntFromMemory(MemoryOffset.MAP_AREA_COLOR);
myProfile.updateClientValues(); myProfile.updateClientValues();
if (mySession!=null && !firstUpdate) { if (mySession!=null && !firstUpdate) {
myProfile.compareAndAnnounceAllChangedValues(); myProfile.compareAndAnnounceAllChangedValues();
@ -326,6 +687,7 @@ public class RabiRaceModule extends Module{
myProfile.stat_update_required=true; myProfile.stat_update_required=true;
firstUpdate=false; firstUpdate=false;
} }
myProfile.playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
if (mySession!=null) { if (mySession!=null) {
for (Profile p : mySession.getPlayers()) { for (Profile p : mySession.getPlayers()) {
if (!p.username.equalsIgnoreCase(myProfile.username)) { if (!p.username.equalsIgnoreCase(myProfile.username)) {
@ -365,6 +727,36 @@ public class RabiRaceModule extends Module{
return mem.getFloat(0); 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) { public float readFloatFromMemoryOffset(MemoryOffset val, long pointer) {
Memory mem = new Memory(4); Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer+val.getOffset()), mem, 4, null); 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) { MemoryOffset end_range) {
int count=0; StringBuilder sb = new StringBuilder();
for (long i=start_range.getOffset();i<=end_range.getOffset();i++) { for (long i=start_range.getOffset();i<=end_range.getOffset();i+=4) {
if (readIntFromMemory(i)==1) { sb.append(readIntFromMemory(i));
count++;
}
} }
return count; return sb.toString();
} }
public void draw(Graphics g) { public void draw(Graphics g) {
@ -478,11 +868,15 @@ public class RabiRaceModule extends Module{
create_button.draw(g); 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); g.fillRect((int)(position.getX()), (int)(position.getY()+position.getHeight()-28-20), (int)(position.getWidth()), 20);
for (int i=0;i<messages.size();i++) { for (int i=0;i<messages.size();i++) {
messages.get(i).draw(g); 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; package sig.modules.RabiRibi;
public enum MemoryOffset { public enum MemoryOffset {
MONEY(0xD654CC,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12FE9B4), MONEY(0x167C10C,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12FE9B4,0x167908C,0),
PLAYTIME(0xD642D8,0x12D97A8+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DB050+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12DB040+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), //In frames (Rabi-Ribi runs at 60FPS). 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". //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,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
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),
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),
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),
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),
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),
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),
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),
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),
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),
/*ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer. /*ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer.
ERINA_HP(0x4D8), ERINA_HP(0x4D8),
ERINA_MAXHP(0x4E8), ERINA_MAXHP(0x4E8),
@ -38,134 +28,174 @@ public enum MemoryOffset {
GAME_DIFFICULTY(0xD64338,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D9818+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D9808+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), 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(0xD6D05C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12E253C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12E252C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851),
DLC_ITEM2(0xD63398,0xD63398+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,0x12D886C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), 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(0,0x12D8874+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D8884+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8874+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), 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(0,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8888-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), BUNNY_MEMORIES(0x1679FE8,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8888-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190,0x1676F68,0),
WIND_BLESSING(0,0x12D7870,0x12D8880+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8880-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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), 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 //13413E8
ITEM_PERCENT(0,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366408),
MAP_PERCENT(0,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366404), ITEM_PERCENT(0x16E8080,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366408,0x16E4900,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), MAP_PERCENT(0x16E807C,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366404,0x16E48FC,0), //Float
PAUSED(0,0xC969A0,0xC979A0,0xCBB9AC), 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_v185;
long offset_v188; long offset_v188;
long offset_v190; long offset_v190;
long offset_v199;
long offset_v199t;
long latest_offset; long latest_offset;
MemoryOffset(long offset,long offset_v185,long offset_v188,long offset_v190) { MemoryOffset(long offset,long offset_v185,long offset_v188,long offset_v190,long offset_v199,long offset_v199t) {
this.offset=offset; this.base_offset=offset;
this.offset_v185=offset_v185; this.offset_v185=offset_v185;
this.offset_v188=offset_v188; this.offset_v188=offset_v188;
this.offset_v190=offset_v190; this.offset_v190=offset_v190;
this.offset_v199=offset_v199;
this.offset_v199t=offset_v199t;
//TODO CHANGE THIS IF PUBLIC VERSION CHANGES! //TODO CHANGE THIS IF PUBLIC VERSION CHANGES!
this.latest_offset = offset_v190; this.latest_offset = offset_v199t;
} }
public long getOffset() { public long getOffset() {
return latest_offset; return base_offset+latest_offset;
} }
public long getOffsetV175() { public long getOriginalOffset() {
return offset; return base_offset;
} }
public long getOffsetV185() { public long getOffsetV185() {
@ -190,4 +220,6 @@ class OffsetHelper{
final static long MEMORY_OFFSET_V175_TO_V1881 = KEY_ITEM_OFFSET_V175_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_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 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.Color;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@ -129,6 +130,26 @@ public class RabiRibiModule extends Module{
}, 1000, 1000, TimeUnit.MILLISECONDS); }, 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() { public void ApplyConfigWindowProperties() {
sigIRC.rabiribimodule_X=(int)position.getX(); sigIRC.rabiribimodule_X=(int)position.getX();
sigIRC.rabiribimodule_Y=(int)position.getY(); sigIRC.rabiribimodule_Y=(int)position.getY();

@ -113,6 +113,26 @@ public class TouhouMotherModule extends Module implements ActionListener{
CheckTouhouMotherClient(); CheckTouhouMotherClient();
}, 5000, 5000, TimeUnit.MILLISECONDS); }, 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() { private void CheckTouhouMotherClient() {
List<Integer> pids; List<Integer> pids;

@ -1,45 +1,43 @@
package sig.modules.Twitch; package sig.modules.Twitch;
import java.io.File; import java.io.File;
import java.text.DateFormat;
import com.mb3364.twitch.api.models.User;
import sig.modules.TwitchModule; import sig.modules.TwitchModule;
import sig.utils.FileUtils; import sig.utils.FileUtils;
public class Announcement { public class Announcement {
User userData; Follower userData;
long twitchID; long twitchID;
public Announcement(long twitchID) { public Announcement(long twitchID) {
String userFilePath = TwitchModule.USERDIR+twitchID; String userFilePath = TwitchModule.USERDIR+twitchID;
File userFile = new File(userFilePath); File userFile = new File(userFilePath);
if (userFile.exists()) { if (userFile.exists()) {
int i=0;
String[] contents = FileUtils.readFromFile(userFilePath); String[] contents = FileUtils.readFromFile(userFilePath);
userData = new User(); userData = new Follower(twitchID,
int i=1; contents[1],
userData.setId(twitchID); contents[0],
userData.setBio(contents[i++]); contents[2],
userData.setDisplayName(contents[i++]); contents[3],
userData.setLogo(contents[i++]); contents[4],
userData.setName(contents[i++]); contents[5],
userData.setType(contents[i++]); contents[6]);
} else { } else {
System.out.println("WARNING! Could not find user with ID "+twitchID+"!"); System.out.println("WARNING! Could not find user with ID "+twitchID+"!");
} }
this.twitchID=twitchID; this.twitchID=twitchID;
} }
public Announcement(User data) { public Announcement(Follower data) {
this.userData=data; this.userData=data;
this.twitchID=data.getId(); this.twitchID=data.id;
} }
public String toString() { public String toString() {
return userData.toString(); return userData.toString();
} }
public User getUser() { public Follower getUser() {
return userData; 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.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.text.DateFormat; import java.text.DateFormat;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
@ -21,17 +23,15 @@ import java.util.List;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import com.mb3364.twitch.api.handlers.ChannelFollowsResponseHandler; import org.json.JSONArray;
import com.mb3364.twitch.api.handlers.StreamResponseHandler; import org.json.JSONException;
import com.mb3364.twitch.api.handlers.UserResponseHandler; import org.json.JSONObject;
import com.mb3364.twitch.api.models.ChannelFollow;
import com.mb3364.twitch.api.models.Stream;
import com.mb3364.twitch.api.models.User;
import sig.Module; import sig.Module;
import sig.sigIRC; import sig.sigIRC;
import sig.modules.Twitch.Announcement; import sig.modules.Twitch.Announcement;
import sig.modules.Twitch.FancyNumber; import sig.modules.Twitch.FancyNumber;
import sig.modules.Twitch.Follower;
import sig.utils.DrawUtils; import sig.utils.DrawUtils;
import sig.utils.FileUtils; import sig.utils.FileUtils;
import sig.utils.SoundUtils; import sig.utils.SoundUtils;
@ -51,17 +51,19 @@ public class TwitchModule extends Module{
int lastFollowerCheck=300; int lastFollowerCheck=300;
final static int FOLLOWERANNOUNCEMENTTIME = 300; final static int FOLLOWERANNOUNCEMENTTIME = 300;
int lastFollowerAnnouncement=0; int lastFollowerAnnouncement=0;
User announcedFollowerUser; //User announcedFollowerUser;
String[] followersounds = new String[]{"Glaceon_cry.wav"}; String[] followersounds = new String[]{"Glaceon_cry.wav"};
FancyNumber viewers_numb; FancyNumber viewers_numb;
FancyNumber followers_numb; FancyNumber followers_numb;
FancyNumber views_numb; FancyNumber views_numb;
Date uptime = Calendar.getInstance().getTime(); ZonedDateTime uptime;
String currentlyPlaying=" "; String currentlyPlaying=" ";
final public static int ARROWTIMER = 3000; final public static int ARROWTIMER = 3000;
public static BufferedImage UPARROWIMAGE; public static BufferedImage UPARROWIMAGE;
public static BufferedImage DOWNARROWIMAGE; public static BufferedImage DOWNARROWIMAGE;
public static BufferedImage UPTIMEIMAGE; public static BufferedImage UPTIMEIMAGE;
public static long myTwitchChannelID = 0;
public int previous_xoffset = 0;
public TwitchModule(Rectangle2D bounds, String moduleName) { public TwitchModule(Rectangle2D bounds, String moduleName) {
this(bounds,moduleName,true); this(bounds,moduleName,true);
@ -81,6 +83,11 @@ public class TwitchModule extends Module{
if (firstTime) { if (firstTime) {
CreateFollowerQueueLog(); CreateFollowerQueueLog();
} }
ClearFollowerAnnouncerQueue();
//myTwitchChannelID = getMyChannelID();
/*manager.streams().get("theduckishot", new StreamResponseHandler() { /*manager.streams().get("theduckishot", new StreamResponseHandler() {
@Override @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() { private void InitializeFollowerSounds() {
File follower_sounds_dir = new File(SOUNDSDIR); File follower_sounds_dir = new File(SOUNDSDIR);
String[] files = filterFiles(follower_sounds_dir.list()); String[] files = filterFiles(follower_sounds_dir.list());
@ -157,15 +184,65 @@ public class TwitchModule extends Module{
public void run() { public void run() {
if (lastFollowerCheck--<=0) { if (lastFollowerCheck--<=0) {
lastFollowerCheck = FOLLOWERCHECKTIMER; lastFollowerCheck = FOLLOWERCHECKTIMER;
getFollowers(false); //getFollowers(false);
try {
GetFollowerAndStreamData();
} catch (IOException e1) {
e1.printStackTrace();
}
popFollowerFromQueue(); 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) { if (lastFollowerAnnouncement>0) {
lastFollowerAnnouncement--; lastFollowerAnnouncement--;
} }
//System.out.println(lastFollowerCheck); //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() { public void ApplyConfigWindowProperties() {
sigIRC.twitchmodule_X=(int)position.getX(); sigIRC.twitchmodule_X=(int)position.getX();
@ -176,20 +253,22 @@ public class TwitchModule extends Module{
private void popFollowerFromQueue() { private void popFollowerFromQueue() {
if (sigIRC.testMode) { if (sigIRC.testMode) {
User user = new User(); Follower user = new Follower("0","I am an awesome test subject.",
user.setDisplayName("Test User"+((int)Math.random()*100000)); new Date().toString(),
user.setBio("I am an awesome test subject."); "Test User"+((int)Math.random()*100000),
user.setName(user.getDisplayName()); "http://45.33.13.215:8080/sigIRCv2/sigIRC/sigIRCicon.png",
user.setLogo("http://45.33.13.215/sigIRCv2/sigIRC/sigIRCicon.png"); "Test User",
"",
new Date().toString());
DisplayFollowerAnnouncement(user,true); DisplayFollowerAnnouncement(user,true);
} else } else
if (follower_queue.size()>0) { if (follower_queue.size()>0) {
if (isStreamOnline()) { if (streamOnline) {
//We have a follower to announce! //We have a follower to announce!
Announcement a = follower_queue.remove(0); Announcement a = follower_queue.remove(0);
User user = a.getUser(); Follower user = a.getUser();
if (user.getDisplayName().length()>0 && if (user.display_name.length()>0 &&
!user.getDisplayName().contains("?")) { !user.display_name.contains("?")) {
DisplayFollowerAnnouncement(user,true); DisplayFollowerAnnouncement(user,true);
} else { } else {
DisplayFollowerAnnouncement(user,false); DisplayFollowerAnnouncement(user,false);
@ -207,22 +286,25 @@ public class TwitchModule extends Module{
private void StoreRemainingFollowers() { private void StoreRemainingFollowers() {
for (Announcement a : follower_queue) { for (Announcement a : follower_queue) {
FileUtils.logToFile(Long.toString(a.getUser().getId()), FOLLOWERQUEUEFILE); FileUtils.logToFile(Long.toString(a.getUser().id), FOLLOWERQUEUEFILE);
} }
follower_queue.clear(); follower_queue.clear();
} }
private void DisplayFollowerAnnouncement(User user, boolean useNickname) {
public static Follower announcedFollowerUser;
private void DisplayFollowerAnnouncement(Follower user, boolean useNickname) {
lastFollowerAnnouncement = FOLLOWERANNOUNCEMENTTIME; lastFollowerAnnouncement = FOLLOWERANNOUNCEMENTTIME;
if (!useNickname) { if (!useNickname) {
user.setDisplayName(user.getName()); user.display_name=user.name;
} }
announcedFollowerUser = user; announcedFollowerUser = user;
String followerAnnouncement = user.getDisplayName()+" is now following the stream!"; String followerAnnouncement = user.display_name+" is now following the stream!";
String userlogo = USERDIR+user.getId()+"_logo"; String userlogo = USERDIR+user.id+"_logo";
if (user.getLogo()!=null && !user.getLogo().equalsIgnoreCase("null")) { if (user.logo_url!=null && !user.logo_url.equalsIgnoreCase("null")) {
try { 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); File logo = new File(userlogo);
if (logo.exists()) { if (logo.exists()) {
followerUserLogo = ImageIO.read(logo); followerUserLogo = ImageIO.read(logo);
@ -266,31 +348,7 @@ 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() { private void ClearFollowerAnnouncerQueue() {
String[] contents = FileUtils.readFromFile(FOLLOWERQUEUEFILE); String[] contents = FileUtils.readFromFile(FOLLOWERQUEUEFILE);
//System.out.println("Contents: "+Arrays.toString(contents)); //System.out.println("Contents: "+Arrays.toString(contents));
@ -299,107 +357,59 @@ public class TwitchModule extends Module{
if (s.length()>0) { if (s.length()>0) {
int twitchID = Integer.parseInt(s); int twitchID = Integer.parseInt(s);
AddFollowerToQueue(twitchID); AddFollowerToQueue(twitchID);
} }
} }
} }
private boolean isStreamOnline() {
return isStreamOnline(false);
}
private boolean isStreamOnline(boolean update) { protected void addFollower(String username, long id, boolean streamOnline, boolean silent) {
if (update) { String filename = USERDIR + Long.toString(id);
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();
File userProfile = new File(filename); File userProfile = new File(filename);
if (!userProfile.exists()) { 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 (!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) { if (!streamOnline) {
//Save their ID to a queue. //Save their ID to a queue.
FileUtils.logToFile(Long.toString(f.getUser().getId()), FOLLOWERQUEUEFILE); FileUtils.logToFile(Long.toString(id), FOLLOWERQUEUEFILE);
} else { } else {
//Announce it now. //Announce it now.
//System.out.println("Stream is online..."); //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 { 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(); userProfile.createNewFile();
FileUtils.logToFile(DateFormat.getDateInstance().format(f.getCreatedAt()), filename); System.out.println("Profile Image URL: "+userdata.getString("profile_image_url"));
FileUtils.logToFile(f.getUser().getBio(), filename); FileUtils.logToFile(new Date().toString(), filename);
FileUtils.logToFile(f.getUser().getDisplayName(), filename); FileUtils.logToFile(userdata.getString("description"), filename);
FileUtils.logToFile(f.getUser().getLogo(), filename); FileUtils.logToFile(username, filename);
FileUtils.logToFile(f.getUser().getName(), filename); FileUtils.logToFile(userdata.getString("profile_image_url"), filename);
FileUtils.logToFile(f.getUser().getType(), filename); FileUtils.logToFile(userdata.getString("login"), filename);
FileUtils.logToFile(DateFormat.getDateInstance().format(f.getUser().getUpdatedAt()), filename); FileUtils.logToFile(userdata.getString("type"), filename);
FileUtils.logToFile(new Date().toString(), filename);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
private void AnnounceFollower(ChannelFollow f) { private void AnnounceFollower(String name,long id) {
//System.out.println("Thanks for following "+f.getUser().getDisplayName()+"!"); System.out.println("Thanks for following "+name+"!");
AddFollowerToQueue(f.getUser()); AddFollowerToQueue(id);
} }
private void AddFollowerToQueue(int id) { private void AddFollowerToQueue(long id) {
follower_queue.add(new Announcement(id)); follower_queue.add(new Announcement(id));
} }
private void AddFollowerToQueue(User user) { // private void AddFollowerToQueue(User user) {
follower_queue.add(new Announcement(user)); // follower_queue.add(new Announcement(user));
} // }
private boolean CreateUserFolder() { private boolean CreateUserFolder() {
File userDir = new File(USERDIR); 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()}, 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}, new int[]{yoffset-4,yoffset-4,yoffset+16,yoffset+16},
4); 4);
previous_xoffset = xoffset;
if (currentlyPlaying!=null && currentlyPlaying.length()>0) { 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; 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 xoffset = 0;
int yoffset = 0; int yoffset = 0;
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, sigIRC.panel);xoffset+=UPTIMEIMAGE.getWidth()+4; 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) { 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; 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)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(), 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); -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 textY = (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration;
int textX = (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration; int textX = (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration;
if (textY<position.getY()+position.getHeight() && textX+usernameTextsize.getWidth()>position.getX()) { 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) { if (followerUserLogo!=null) {
final int image_size = sigIRC.twitchmodule_newfollowerImgLogoSize; final int image_size = sigIRC.twitchmodule_newfollowerImgLogoSize;
int img_startx = (int)(position.getX()+position.getWidth()-ticksPassed*3-(image_size+4)); 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); int img_starty = (int)(position.getY()+follower_img.getHeight()+2-image_size/2);
//g.setColor(Color.BLACK); g.setColor(Color.BLACK);
//g.drawRect(img_startx, img_starty, image_size, image_size); 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); 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) { 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.getBio()); 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);
} }
} }
} }

@ -6,12 +6,6 @@ import javax.swing.Timer;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; 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.Memory;
import com.sun.jna.Native; import com.sun.jna.Native;
import com.sun.jna.Pointer; import com.sun.jna.Pointer;
@ -32,6 +26,7 @@ import sig.modules.TouhouMotherModule;
import sig.modules.TwitchModule; import sig.modules.TwitchModule;
import sig.modules.ChatLog.ChatLogMessage; import sig.modules.ChatLog.ChatLogMessage;
import sig.modules.ChatLog.ChatLogTwitchEmote; import sig.modules.ChatLog.ChatLogTwitchEmote;
import sig.modules.Controller.ControlConfigurationWindow;
import sig.modules.utils.MyKernel32; import sig.modules.utils.MyKernel32;
import sig.modules.utils.PsapiTools; import sig.modules.utils.PsapiTools;
import sig.utils.FileUtils; import sig.utils.FileUtils;
@ -58,12 +53,14 @@ import java.io.OutputStreamWriter;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.Socket; import java.net.Socket;
import java.net.SocketException;
import java.net.URL; import java.net.URL;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.TimerTask;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -98,9 +95,10 @@ public class sigIRC{
static int dingThreshold; static int dingThreshold;
static Color backgroundcol; static Color backgroundcol;
public static BackgroundColorButton button; public static BackgroundColorButton button;
public static ModuleSelectorButton modulebutton;
public static JFrame window; public static JFrame window;
static boolean overlayMode=false; static boolean overlayMode=false;
static boolean showWindowControls=false; public static boolean showWindowControls=false;
static int windowX=0; static int windowX=0;
static int windowY=0; static int windowY=0;
static int windowWidth=0; static int windowWidth=0;
@ -114,8 +112,8 @@ public class sigIRC{
static Integer messageFontSize = 24; static Integer messageFontSize = 24;
static Integer usernameFontSize = 16; static Integer usernameFontSize = 16;
static Integer touhoumotherConsoleFontSize = 12; static Integer touhoumotherConsoleFontSize = 12;
static boolean touhoumothermodule_enabled=false; public static boolean touhoumothermodule_enabled=false;
static boolean twitchmodule_enabled=true; public static boolean twitchmodule_enabled=true;
public static boolean chatlogmodule_enabled=true; public static boolean chatlogmodule_enabled=true;
static boolean downloadsComplete=false; static boolean downloadsComplete=false;
static boolean hardwareAcceleration=true; static boolean hardwareAcceleration=true;
@ -165,6 +163,9 @@ public class sigIRC{
public static String twitchmodule_newfollowerImgBackgroundColor="90,90,90"; public static String twitchmodule_newfollowerImgBackgroundColor="90,90,90";
public static String twitchmodule_newfollowerShadowTextColor="26,90,150"; public static String twitchmodule_newfollowerShadowTextColor="26,90,150";
public static String twitchmodule_newfollowerTextColor="255,255,255"; 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 String chatlogmodule_backgroundColor="195,195,195,255";
public static int twitchmodule_newfollowerImgLogoSize=32; public static int twitchmodule_newfollowerImgLogoSize=32;
public static boolean testMode=false; public static boolean testMode=false;
@ -174,8 +175,14 @@ public class sigIRC{
public static int lastSubEmoteUpdate = -1; public static int lastSubEmoteUpdate = -1;
public static boolean autoUpdateProgram = true; public static boolean autoUpdateProgram = true;
public static Image programIcon; 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 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 int subchannelCount = 0;
public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>(); public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>();
@ -187,14 +194,40 @@ public class sigIRC{
static int lastWindowX = 0; static int lastWindowX = 0;
static int lastWindowY = 0; static int lastWindowY = 0;
public static String longString = "10988989d"; public static String longString = "10988989d";
public static Twitch manager = new Twitch(); public static ModuleSelector moduleSelectorWindow;
public static String oauth;
public static void main(String[] args) { 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(); config = InitializeConfigurationFile();
server = config.getProperty("server"); server = config.getProperty("server");
nickname = config.getProperty("nickname"); nickname = config.getProperty("nickname");
channel = config.getProperty("channel"); channel = config.getProperty("channel");
try {
channel_id = sigIRC.GetChannelID(channel.replace("#", ""));
} catch (IOException e) {
e.printStackTrace();
}
overlayMode = config.getBoolean("overlayMode", false); overlayMode = config.getBoolean("overlayMode", false);
showWindowControls = config.getBoolean("showWindowControls", true); showWindowControls = config.getBoolean("showWindowControls", true);
windowX = config.getInteger("windowX", 0); windowX = config.getInteger("windowX", 0);
@ -221,7 +254,7 @@ public class sigIRC{
twitchmodule_follower_img = config.getProperty("TWITCH_module_follower_img","sigIRC/glaceon_follower.png"); 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_follower_img_animation = config.getBoolean("TWITCH_module_follower_img_animation",true);
twitchmodule_followerText_centerX = config.getInteger("TWITCH_module_followerText_centerX",292); 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_newfollowerImgLogoSize = config.getInteger("TWITCH_module_newFollowerImgLogoSize",32);
twitchmodule_newfollowerImgBackgroundColor = config.getProperty("TWITCH_module_newFollowerImgBackgroundColor","90,90,90"); twitchmodule_newfollowerImgBackgroundColor = config.getProperty("TWITCH_module_newFollowerImgBackgroundColor","90,90,90");
twitchmodule_newfollowerShadowTextColor = config.getProperty("TWITCH_module_newFollowerShadowTextColor","26,90,150"); twitchmodule_newfollowerShadowTextColor = config.getProperty("TWITCH_module_newFollowerShadowTextColor","26,90,150");
@ -267,7 +300,10 @@ public class sigIRC{
autoUpdateProgram = config.getBoolean("Automatically_Update_Program", true); autoUpdateProgram = config.getBoolean("Automatically_Update_Program", true);
disableChatMessages = config.getBoolean("Disable_Chat_Messages", false); disableChatMessages = config.getBoolean("Disable_Chat_Messages", false);
lastSubEmoteUpdate = config.getInteger("lastSubEmote_APIUpdate",Calendar.getInstance().get(Calendar.DAY_OF_YEAR)); 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()); //System.out.println(manager.auth().hasAccessToken());
DownloadAllRequiredDependencies(); DownloadAllRequiredDependencies();
@ -277,10 +313,6 @@ public class sigIRC{
e.printStackTrace(); e.printStackTrace();
}*/ }*/
String[] filedata = FileUtils.readFromFile(BASEDIR+"sigIRC/oauthToken.txt");
final String oauth = filedata[0];
Initialize(); Initialize();
WriteBreakToLogFile(); WriteBreakToLogFile();
@ -327,6 +359,7 @@ public class sigIRC{
manager = new FileManager("sigIRC/Emotes/",true); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/Emotes/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/subscribers.txt"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/subscribers.txt"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/logs/",true); 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/sounds/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/rabi-ribi/",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/unknown.png"); manager.verifyAndFetchFileFromServer();
@ -354,12 +387,15 @@ public class sigIRC{
manager = new FileManager("sigIRC/controller/controller_overlay.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/controller/controller_overlay.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/controller/controller_template.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/CP_Font.ttf"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/collect_item.wav"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("kill.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("kill.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("memory"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("memory"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("swap.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("swap.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("update.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("update.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("backcolor.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("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/stamps1.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/stamps2_2.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/stamps2_2.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/stamp_what_a_great_idea.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/stamp_what_a_great_idea.png"); manager.verifyAndFetchFileFromServer();
@ -389,10 +425,10 @@ public class sigIRC{
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
newUpdateIsAvailable = true;
} }
} }
} }
private static void InitializeModules() { private static void InitializeModules() {
try { try {
Module.IMG_DRAGBAR = ImageIO.read(new File(sigIRC.BASEDIR+"drag_bar.png")); Module.IMG_DRAGBAR = ImageIO.read(new File(sigIRC.BASEDIR+"drag_bar.png"));
@ -437,10 +473,7 @@ public class sigIRC{
)); ));
} }
if (bandorimodule_enabled) { if (bandorimodule_enabled) {
modules.add(new BandoriModule( BandoriModule.loadModule();
new Rectangle(bandorimodule_X,bandorimodule_Y,bandorimodule_width,bandorimodule_height),
"Bandori"
));
} }
if (ddrstepmodule_enabled) { if (ddrstepmodule_enabled) {
modules.add(new DDRStepModule( modules.add(new DDRStepModule(
@ -448,6 +481,7 @@ public class sigIRC{
"DDR Step" "DDR Step"
)); ));
} }
moduleSelectorWindow = new ModuleSelector();
} }
private static void InitializeCustomSounds() { private static void InitializeCustomSounds() {
@ -476,17 +510,30 @@ public class sigIRC{
writer.flush(); writer.flush();
runIRCLoop(channel, writer, reader); runIRCLoop(channel, writer, reader);
} }
} catch (UnknownHostException e) { } catch (UnknownHostException | SocketException e) {
e.printStackTrace(); //e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (retryCounter<MAX_CONNECTION_RETRIES) { new java.util.Timer().schedule(new TimerTask() {
InitializeIRCConnection(server,nickname,channel,oauth); public void run() {
} else { InitializeIRCConnection(server,nickname,channel,oauth);
sigIRC.panel.addMessage("Connection timed out. Please restart and try again."); if (retryCount>1) {
System.out.println("Connection timed out. Please restart and try again."); 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() { public static void WriteBreakToLogFile() {
@ -496,8 +543,28 @@ public class sigIRC{
FileUtils.logToFile("\n---------------------------\n", BASEDIR+"logs/log_"+(cal.get(Calendar.MONTH)+1)+"_"+cal.get(Calendar.DAY_OF_MONTH)+"_"+cal.get(Calendar.YEAR)+".txt"); FileUtils.logToFile("\n---------------------------\n", BASEDIR+"logs/log_"+(cal.get(Calendar.MONTH)+1)+"_"+cal.get(Calendar.DAY_OF_MONTH)+"_"+cal.get(Calendar.YEAR)+".txt");
} }
} }
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) { /*private static void getSubChannels(String channelName) {
manager.channels().get(channelName, new ChannelResponseHandler() { manager.channels().get(channelName, new ChannelResponseHandler() {
@Override @Override
public void onFailure(Throwable arg0) { public void onFailure(Throwable arg0) {
@ -516,23 +583,29 @@ public class sigIRC{
}); });
//TwitchModule.streamOnline=true; //TwitchModule.streamOnline=true;
//return true; //return true;
} }*/
public static void downloadSubEmotes(JSONObject data) { public static void downloadSubEmotes() {
for (Long l : subchannelIds.keySet()) { for (Long l : subchannelIds.keySet()) {
JSONObject channel = data.getJSONObject(Long.toString(l)); JSONObject channel;
JSONArray arr = channel.getJSONArray("emotes"); try {
//System.out.println("Channel: "+channel); channel = FileUtils.readJsonFromUrl("https://api.twitchemotes.com/api/v4/channels/"+l);
for (int i=0;i<arr.length();i++) { //String channel = subchannelIds.get(l);
JSONObject emote = arr.getJSONObject(i); JSONArray arr = channel.getJSONArray("emotes");
int id = emote.getInt("id"); //System.out.println("Channel: "+channel);
String name = emote.getString("code"); for (int i=0;i<arr.length();i++) {
//System.out.println("Emote "+(i+1)+" has id "+id+" and code "+name+"."); JSONObject emote = arr.getJSONObject(i);
try { int id = emote.getInt("id");
emoticon_queue.add(new SubEmoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0"), subchannelIds.get(l))); String name = emote.getString("code");
} catch (MalformedURLException e) { System.out.println("Emote "+(i+1)+" has id "+id+" and code "+name+".");
e.printStackTrace(); 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; //TwitchModule.streamOnline=true;
@ -541,14 +614,17 @@ public class sigIRC{
private static void performTwitchEmoteUpdate() { private static void performTwitchEmoteUpdate() {
try { 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."); System.out.println("Twitch emote Json read.");
for (String emotes : twitchemotes.keySet()) { JSONArray emotes = twitchemotes.getJSONArray("emotes");
JSONObject emote = twitchemotes.getJSONObject(emotes); for (int i=0;i<emotes.length();i++) {
JSONObject emote = emotes.getJSONObject(i);
int id = emote.getInt("id"); int id = emote.getInt("id");
String name = emote.getString("code"); if (id>14) {
emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0"))); String name = emote.getString("code");
System.out.println("Emote "+id+" with name "+name); 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); //System.out.println("Subscriber object: "+subemotes);
String[] channel_names = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/subscribers.txt"); String[] channel_names = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/subscribers.txt");
@ -558,6 +634,7 @@ public class sigIRC{
if (s.length()>0) { if (s.length()>0) {
s=s.trim(); s=s.trim();
//System.out.println("Got sub emote info for "+s); //System.out.println("Got sub emote info for "+s);
//TODO Rewrite.
getSubChannels(s); getSubChannels(s);
} }
} }
@ -688,6 +765,7 @@ public class sigIRC{
f.setIconImage(programIcon); f.setIconImage(programIcon);
button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing); 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) { if (sigIRC.overlayMode) {
f.setBackground(new Color(0,0,0,0)); f.setBackground(new Color(0,0,0,0));
f.setAlwaysOnTop(true); f.setAlwaysOnTop(true);

@ -30,6 +30,9 @@ public class DrawUtils {
if (message.length()>0) { if (message.length()>0) {
AttributedString as = new AttributedString(message); AttributedString as = new AttributedString(message);
as.addAttribute(TextAttribute.FONT, font); 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); g.setColor(shadow_color);
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext(); FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext();
@ -55,9 +58,12 @@ public class DrawUtils {
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset)); 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); Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(message, font);
drawOutlineText(g,font,x,y,-textBounds.getWidth()/2,-textBounds.getHeight()/2,1,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) { public static void drawText(Graphics g, double x, double y, Color color, String message) {
if (message.length()>0) { if (message.length()>0) {

@ -8,11 +8,19 @@ import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Reader; import java.io.Reader;
import java.io.Writer;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -22,6 +30,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import sig.sigIRC; import sig.sigIRC;
import sig.modules.RabiRaceModule;
import sig.modules.ChatLog.ChatLogMessage; import sig.modules.ChatLog.ChatLogMessage;
public class FileUtils { public class FileUtils {
@ -237,9 +246,14 @@ public class FileUtils {
} }
public static void logToFile(String message, String filename) { 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) { public static void logToFile(String message, String filename, boolean outputToChatLog) {
File file = new File(filename); File file = new File(filename);
try { try {
@ -247,9 +261,9 @@ public class FileUtils {
if (!file.exists()) { if (!file.exists()) {
file.createNewFile(); file.createNewFile();
} }
OutputStream out = new FileOutputStream(file,true);
FileWriter fw = new FileWriter(file, true); Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
PrintWriter pw = new PrintWriter(fw); PrintWriter pw = new PrintWriter(writer);
pw.println(message); pw.println(message);
pw.flush(); pw.flush();
@ -302,4 +316,36 @@ public class FileUtils {
file.delete(); 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
}
} }

@ -1,18 +0,0 @@
SigoNitori
25
0
0
0
0
0
0
0
false
0
0
5.361208E-36
4.8674998E-36
1536205835
KEYITEMS:
BADGES:
UPDATES:
Loading…
Cancel
Save