diff --git a/sessions b/sessions index 689e24e..4ef4e1f 100644 --- a/sessions +++ b/sessions @@ -1,3 +1,2 @@ -19,1584088712,1584089249,SigoNitori's Race,4,none,,5.00,0,5,true -20,1584089263,1584089710,SigoNitori's Race,4,none,,5.00,0,48,false -21,1584089784,1584089803,SigoNitori's Race,4,none,sigonitori,5.00,0,80,true +40,1584212818,1584213383,SigoNitori's Race,4,none,,5.00,0,5,false +41,1584213387,1584213632,SigoNitori's Race,4,none,sigonitori,5.00,0,5,false diff --git a/sigIRCv2.jar b/sigIRCv2.jar index 93ce347..11afb8a 100644 Binary files a/sigIRCv2.jar and b/sigIRCv2.jar differ diff --git a/src/sig/modules/RabiRaceModule.java b/src/sig/modules/RabiRaceModule.java index 34dba46..d309448 100644 --- a/src/sig/modules/RabiRaceModule.java +++ b/src/sig/modules/RabiRaceModule.java @@ -52,6 +52,10 @@ import sig.utils.SoundUtils; import sig.utils.TextUtils; public class RabiRaceModule extends Module{ + final static int ERINA = 0; + final static int RIBBON = 1; + final static int CICINI = 2; + final static int MIRIAM = 3; final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/"; final static String AVATAR_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/characters/"; final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ | WinNT.PROCESS_VM_WRITE; @@ -70,6 +74,7 @@ public class RabiRaceModule extends Module{ public static Session mySession; boolean firstCheck=false; public List messages = new ArrayList(); + public List messagequeue = new ArrayList(); public static int lastScrollX = 0; boolean firstUpdate=true; boolean mouseoverAvatar=false; @@ -231,6 +236,7 @@ public class RabiRaceModule extends Module{ /*message_played=true; System.out.println("Perform item sync with other players."); SyncItemsWithOtherPlayers();*/ + messagequeue.add(s); if (mySession!=null && mySession.isCoop()) { syncItems=true; } @@ -411,16 +417,35 @@ public class RabiRaceModule extends Module{ messages.remove(i--); } } + + if (messagequeue.size()>0) { + if (NoMessageDisplayed()) { + int character=0; + character = messagequeue.get(0).contains(myProfile.displayName)?RabiRaceModule.ERINA:RabiRaceModule.RIBBON; + DisplayMessage(messagequeue.get(0).length()>255?messagequeue.remove(0).substring(0,255):messagequeue.remove(0),8,character); + } + } + if (lastScrollX>0) { lastScrollX-=ScrollingText.SCROLLSPD; } } } + private 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; + } + private void UpdateMyProfile() { if (foundRabiRibi) { //System.out.println("Called."); - int paused = readIntFromMemory(MemoryOffset.PAUSED) + readIntFromMemory(MemoryOffset.TITLE_SCREEN); + int paused = readIntFromMemory(MemoryOffset.PAUSED) + Math.abs(readIntFromMemory(MemoryOffset.TITLE_SCREEN)-1); //int paused = 0; //TODO FORCE UNPAUSE FOR NOW. float itempct = readFloatFromMemory(MemoryOffset.ITEM_PERCENT); myProfile.isPaused = paused>=1; @@ -497,6 +522,16 @@ public class RabiRaceModule extends Module{ //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); diff --git a/src/sig/modules/RabiRibi/MemoryOffset.java b/src/sig/modules/RabiRibi/MemoryOffset.java index be4deaf..ae6a84d 100644 --- a/src/sig/modules/RabiRibi/MemoryOffset.java +++ b/src/sig/modules/RabiRibi/MemoryOffset.java @@ -144,10 +144,21 @@ public enum MemoryOffset { MAP_PERCENT(0x16E807C,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x1366404,0x16E48FC,0), //Float RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199,OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V199T), PAUSED(0x1038D88,0xC969A0,0xC979A0,0xCBB9AC,0x1036D88,0), - TITLE_SCREEN(0x16893F4,0,0,0,0,0), + TITLE_SCREEN(0xDB64C4,0,0,0,0,0), 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. ; long base_offset; diff --git a/tmp_profile b/tmp_profile index 335abcd..5331664 100644 --- a/tmp_profile +++ b/tmp_profile @@ -1,37 +1,25 @@ SigoNitori 10 -1584089765 -965854 -1101111100010000001010000000000000000000000000000000000000011111 -1011000000000000010000001000000000000000000000000000000000011111 +1584213472 +146992 0000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000011110 -0101100111111101010000000000000000000000000000000000000000011111 -21 -true -5 +0000000000000000010000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0 +false +1 1 -25.666666 -40.846153 -1584089809 +2.9 +3.323077 +1584213638 KEYITEMS: -AIR_JUMP;1 -SLIDING_POWDER;1 +HAMMER;1 CARROT_BOMB;1 -SPEED_BOOST;1 RIBBON;1 -RABI_SLIPPERS;1 -QUICK_BARRETTE;1 -LIGHT_ORB;1 -SUNNY_BEAM;1 -BUNNY_STRIKE;1 -BUNNY_AMULET;3 -WATER_ORB;1 -SUPER_CARROT;3 -GOLD_CARROT;1 BADGES: -BADGE_TOXIC_STRIKE;2 -BADGE_SURVIVAL;2 -BADGE_ATK_TRADE;2 -BADGE_PURE_LOVE;2 -UPDATES: \ No newline at end of file +BADGE_DEF_TRADE;1 +UPDATES: +1100000000000000000000000101000000000000001000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +END \ No newline at end of file