Jump to content

AddSlider not showing in mod menu


z2x22

3 posts in this topic

Recommended Posts

this is my tweak code

#include "Macros.h"



/*****************************/
// Please see sample.xm for sample menu code.

// title of your menu
static NSString *const title = @"test"; 

// who made the hack?
static NSString *const credits = @"test";

// what font do you want the text to be? don't put anything for the default font
static NSString *const font = @"";

// should the menu have a blurred background? true or false
// FYI: this won't always look pretty
static const bool blur = true;

// blur style
// you MUST pick from these three: UIBlurEffectStyleExtraLight, UIBlurEffectStyleLight, or UIBlurEffectStyleDark
// *** If you opted for no blur background, this is ignored. However, you still need to fill it in. ***
static const UIBlurEffectStyle blurStyle = UIBlurEffectStyleDark;

// A complete list of fonts can be found here: http://iosfonts.com/
/******************************/

%hook MainAppController

- (void)applicationDidBecomeActive:(id)arg0 {
    /* For iOS 11 compatibility, the theme color must be here. */
    /* The overall color for the menu and the button. */
    /* If you want a custom color, use rgb(color code) */
    /* Use rgb(arc4random_uniform(0xFFFFFF)) for a random color each launch. */
    UIColor *themeColor = rgb(arc4random_uniform(0xFFFFFF));

    UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;

    UIButton *openButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    openButton.frame = CGRectMake((main.frame.size.width/2)-15, (main.frame.size.height/2)+75, 30, 30);
    openButton.backgroundColor = [UIColor clearColor];
    openButton.layer.cornerRadius = 16;
    openButton.layer.borderWidth = 2;
    openButton.layer.borderColor = themeColor.CGColor;
    [openButton addTarget:self action:@selector(wasDragged:withEvent:) 
    forControlEvents:UIControlEventTouchDragInside];
    [openButton addTarget:self action:@selector(showMenu) 
    forControlEvents:UIControlEventTouchDownRepeat];

    if(!buttonAdded){
        timer(5){
            UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;
            menu = [[ModMenu alloc] initWithTitle:title credits:credits fontName:font theme:themeColor blur:blur blurStyle:blurStyle];

            /*
            Add features below this comment. Feel free to delete this comment if you're comfortable with how this menu works.

            Things are added to the menu in the order you have added them.

            A Hack is a switch that contains offsets, hacked hexes, and original hexes. Straightforward.
            To create one, call addHack.
            addHack is called as follows: addHack(@"Hack Name", @"The description of your hack", themeColor, {offsets}, {hacked hexes}, {original hexes});
            For example:
            addHack(@"Infinite Ammo", @"Ammo doesn't run out.", themeColor, {0x1001B292A}, {0xC0035FD6}, {0xD213AEB5});
            You can also have multiple offsets, hacked hexes, and original hexes. There's no limit to the number of offsets you can have! For example:
            addHack(@"No Recoil", @"No recoil prevents any recoil from being applied when you shoot.", themeColor, {0x356a7c, 0x110f0a}, {0x7047, 0x7047}, {0xf0b5, 0xf0b5});
            
            A Hook is a switch that used to hook a function and apply a feature. This doesn't make much sense because you cannot "unhook" a function if
            the user wants the feature off. It currently serves no purpose except for backward compatibility. All it does is turn on or off now.

            A SliderHook is a slider that can be customized to have a minimum and maximum value.
            Good for hooking a function and returning user-specified values. To create one, call addSliderHook.
            addSliderHook is called as follows: addSliderHook(@"Hack Name", @"Description of your hack", themeColor, initial value, minimum value, maximum value);
            For example:
            addSliderHook(@"Adjust Field of View", @"Adjust your field of view.", themeColor, 0, 100, 50);
            To get the value of a SliderHook:
            float value = [SliderHook getSliderValueForHook:@"hack name here"];
            int value = (int)[SliderHook getSliderValueForHook:@"hack name here"];

            A TextfieldHook is a textfield. Again, good for hooking a function and returning user-specified values.
            To create one, call addTextfieldHook.
            addTextfieldHook is called as follows: addTextfieldHook(@"Hack name", @"Description of your hack", themeColor);
            For example:
            addTextfieldHook(@"Set Gems", @"Set your gem amount.", themeColor);
            To get the value of a TextfieldHook:
            NSString *value = [TextfieldHook getTextfieldValueForHook:@"hack name here"];
            float value = [[TextfieldHook getTextfieldValueForHook:@"hack name here"] floatValue];
            int value = [[TextfieldHook getTextfieldValueForHook:@"hack name here"] intValue];

            A Switch does nothing but turn on or off. Useful when you are in a hooked function and need to know when to call a function or mod an instance variable.
            Since it doesn't do anything but turn on or off, it is essentially the same thing as a Hook.
            To create one, call addSwitch.
            addSwitch is called as follows:
            addSwitch(@"Hack name", @"Description of your hack", themeColor);
            For example:
            addSwitch(@"Kill Everyone", @"Kill everyone in the lobby", themeColor);
            To test whether or not a Switch is on:
            bool on = [Switch getSwitchOnForSwitch:@"hack name here"];

            If you want to use writeData in your Tweak.xm, now you can! Call writeData like you normally would.
            Call writeData after the menu has been created. If you use it where you add features, you'll be fine.

            Handle hooking with the HOOK and HOOK_NO_ORIG macros. I decided to let you guys handle hooking because
            it is too troublesome to make sure I handle cases where you guys pass parameters incorrectly.

            If I wanted to hook a function called LocalPlayer::Update at 0x1001B762A with a pointer to the original function, I would do this:
            HOOK(0x1001B762A, _LocalPlayer_Update, LocalPlayer_Update);

            Where _LocalPlayer_Update is the function you write, and LocalPlayer_Update is the pointer to the original function.

            You can use HOOK_NO_ORIG if you don't need the pointer to the original function:
            HOOK_NO_ORIG(0x1001B762A, _LocalPlayer_Update);

            If that is too confusing, you can always just use MSHookFunction. HOOK and HOOK_NO_ORIG just wrap MSHookFunction in a cleaner call.
            */

            // add features here!


addSliderHook(@"ffov", @"Adjust your field of view.", themeColor, 0, 100, 0);


addSliderHook(@"Adjust Field of View", @"Adjust your field of view.", themeColor, 0, 100, 50);

            [main addSubview:openButton];
            [main addSubview:menu];

            buttonAdded = true;
        });
    }

    %orig;
}

%new
- (void)showMenu {
    [menu show];
}

%new
- (void)wasDragged:(UIButton *)button withEvent:(UIEvent *)event
{
    UITouch *touch = [[event touchesForView:button] anyObject];

    CGPoint previousLocation = [touch previousLocationInView:button];
    CGPoint location = [touch locationInView:button];
    CGFloat delta_x = location.x - previousLocation.x;
    CGFloat delta_y = location.y - previousLocation.y;

    button.center = CGPointMake(button.center.x + delta_x, button.center.y + delta_y);
}
%end

void (* vp_FPWeapon_Update)(void *vp_FPWeapon);void _vp_FPWeapon_Update(void *vp_FPWeapon) {*(float *)((uint64_t)vp_FPWeapon + 0xC0) =  [SliderHook getSliderValueForHook:@"ffov"];vp_FPWeapon_Update(vp_FPWeapon);}%ctor {MSHookFunction((void *)getRealOffset(0x101977710), (void *)_vp_FPWeapon_Update, (void**)&vp_FPWeapon_Update);}

void addHack(NSString *name, NSString *description, UIColor *theme, std::initializer_list<uint64_t> offsets, std::initializer_list<uint64_t> hackedHexes, std::initializer_list<uint64_t> originalHexes){
    if(menu == nil)
        return;
    
    std::vector<uint64_t> offsetVector;
    std::vector<uint64_t> hackedHexVector;
    std::vector<uint64_t> originalHexVector;
    
    offsetVector.insert(offsetVector.begin(), offsets.begin(), offsets.end());
    hackedHexVector.insert(hackedHexVector.begin(), hackedHexes.begin(), hackedHexes.end());
    originalHexVector.insert(originalHexVector.begin(), originalHexes.begin(), originalHexes.end());
    
    Hack *h = [[Hack alloc] initWithHackName:name info:description fontName:font theme:theme offset:offsetVector hackedHex:hackedHexVector originalHex:originalHexVector];
    [menu addHack:h];
}

void addHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    Hook *h = [[Hook alloc] initWithHookName:name info:description fontName:font theme:theme];
    [menu addHook:h];
}

void addSliderHook(NSString *name, NSString *description, UIColor *theme, float initialValue, float minValue, float maxValue){
    if(menu == nil)
        return;

    if(minValue > maxValue)
        return;
    
    SliderHook *sh = [[SliderHook alloc] initWithSliderHookName:name info:description fontName:font theme:theme initialValue:initialValue minValue:minValue maxValue:maxValue];
    [menu addHook:sh];
}

void addTextfieldHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    TextfieldHook *th = [[TextfieldHook alloc] initWithTextfieldHookName:name info:description fontName:font theme:theme];
    [menu addHook:th];
}

void addSwitch(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    Switch *s = [[Switch alloc] initWithSwitchName:name info:description fontName:font theme:theme];
    [menu addHook:s];
}

void writeData(uint64_t offset, uint64_t hex){
    if(menu == nil)
        return;
    
    [menu writeTo:offset withHex:hex];
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • Stick War: Legacy Cheats (All Versions) +3
      Modded/Hacked App: Stick War: Legacy by 1004319 Alberta Ltd
      Bundle ID: com.stickpage.stickwar
      iTunes Store Link: https://itunes.apple.com/us/app/stick-war-legacy/id1001780528?mt=8&uo=4&at=1010lce4


      Hack Features:
      - Infinite Gold
      - Infinite Gem
      - Fast Build


      Hack Download Link: https://iosgods.com/topic/96767-arm64-stick-war-legacy-cheats-all-versions-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 349 replies
    • Idle Ninja Online v2180 Cheats +15
      Modded/Hacked App: Idle Ninja Online By Puzzle Monsters Inc.
      Bundle ID: com.puzzlemonsters.growninja
      iTunes Store Link: https://apps.apple.com/us/app/idle-ninja-online/id1559182313?uo=4


      Hack Features:
      - no cool skill
      - no need mana
      - speed
      - max level
      - fast shot
      - penetration
      - multi shot
      - far FOV (in setting)
      - can move 
      - reduce animation
      - skin dame (need show damege skin in setting, from 1 to 23)
      - antiban (not sure 100%) 


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 580 replies
    • Sword Master Story Cheats v4.64.520 +5
      Modded/Hacked App: Sword Master Story By SuperPlanet corp.
      Bundle ID: com.superplanet.swordmaster
      iTunes Store Link: https://apps.apple.com/us/app/sword-master-story/id1521447065?uo=4


      Hack Features:
      - Custom Player Stats
      - Weak Enemies
      - One Hit Kill
      - & More

      Press & Hold to read feature description


      iOS Hack Download Link: https://iosgods.com/topic/146819-sword-master-story-cheats-v42294-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,342 replies
    • Toca Boca World Modded v1.90 +1
      Modded/Hacked App: Toca Boca World By Toca Boca AB
      Bundle ID: com.tocaboca.tocalifeworld
      iTunes Store Link: https://apps.apple.com/us/app/toca-boca-world/id1208138685?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features:
      - Everything Purchased


      Non-Jailbroken & No Jailbreak required hack(s): 


      Hack Download Link:

      Hidden Content

      Download Hack








      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above.
      STEP 2: Copy the file over to your iDevice using any of the file managers mentioned above or skip this step if you're downloading from your iDevice.
      STEP 3: Using iFile or Filza, browse to where you saved the downloaded .deb file and tap on it.
      STEP 4: Once you tap on the file, you will then need to press on 'Installer' or 'Install' from the options on your screen.
      STEP 5: Let iFile / Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 6: Now open your iDevice settings and scroll down until you see the settings for this cheat and tap on it. If the hack is a Mod Menu, the cheat features can be toggled in-game.
      STEP 7: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - @Laxus


      Cheat Video/Screenshots:

      N/A

       
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,179 replies
    • [ Dragon Ball Legends Japan ] ドラゴンボール レジェンズ  v5.5.1 - [ Enemies Don't Attack & More]
      Modded/Hacked App: ドラゴンボール レジェンズ By BANDAI NAMCO Entertainment Inc.
      Bundle ID: jp.co.bandainamcoent.BNEI0333
      iTunes Store Link: https://itunes.apple.com/jp/app/ドラゴンボール-レジェンズ/id1358232022?mt=8


      Mod Requirements:
      - Jailbroken or Non-Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Enemies Don't Attack
      - No Ki Cost
      - Unlimited Ki
      - No Character Swap CoolDown
      - No Vanish CoolDown
      - Auto Complete All Challenges - Currency/Chrono Crystals Hack! 
      - Always Critical
      - All Cards Give DragonBall 

       This hack only works on x64 or ARM64 iDevices: iPhone 5s, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, 8, 8 Plus, X, SE, iPod Touch 6G, iPad Air, Air 2, Pro & iPad Mini 2, 3, 4 and later.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,942 replies
    • [ DBL ]ドラゴンボール レジェンズ v5.5.1 - [ Instant - Win & More ]
      Modded/Hacked App: ドラゴンボール レジェンズ By BANDAI NAMCO Entertainment Inc.
      Bundle ID: jp.co.bandainamcoent.BNEI0333
      iTunes Store Link: https://itunes.apple.com/jp/app/ドラゴンボール-レジェンズ/id1358232022


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features:
      - x Player Damage - x1 - 20 
      - x Player Defense - x1 - 20 
      - One Hit Kill
      - God Mode 
      - 1 Enemy Per Quest
      - Instant - Win - Enable It When You In Battle
      - No Swap CoolDown
      - No Vanish CoolDown
      - No KI Cost
      - Auto Complete All Challenges-> Currency/Chrono Crystals Hack!
      - Always Critical
      - Tutorial Bypass
      - All Cards Give DragonBalls

      All functions are unlinked and only for player, you!
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,580 replies
    • Harry Potter: Hogwarts Mystery v5.9.6 - [ Unlimited Energy & More ]
      Modded/Hacked App: Harry Potter: Hogwarts Mystery By Jam City, Inc.
      Bundle ID: com.tinyco.potter
      iTunes Store Link: https://apps.apple.com/us/app/harry-potter-hogwarts-mystery/id1333256716


      Hack Features:
      - Unlimited Energy
      - Max Attributes Level
      - Free Shop - Energy & Some Pets 
      - Max Creature Mastery Level
      - Unlimited Gems - Do Task And You'll Gain Gems
      - Feeding Button Enabled
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 434 replies
    • Harry Potter: Hogwarts Mystery v5.9.6 - [ Unlimited Energy & More ]
      Modded/Hacked App: Harry Potter: Hogwarts Mystery By Jam City, Inc.
      Bundle ID: com.tinyco.potter
      iTunes Store Link: https://apps.apple.com/us/app/harry-potter-hogwarts-mystery/id1333256716


      Hack Features:
      - Unlimited Energy
      - Max Attributes Level
      - Free Shop - Energy & Some Pets 
      - Max Creature Mastery Level
      - Unlimited Gems - Do Task And You'll Gain Gems
      - Feeding Button Enabled
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 815 replies
    • Adorimon: Arena of Ancient v1.3.568 Cheats +4
      Modded/Hacked App: Adorimon: Arena of Ancient By Mai Duc
      Bundle ID: com.ubiplay.petfi.adorimon
      iTunes Store Link: https://apps.apple.com/us/app/adorimon-arena-of-ancient/id6443480229?uo=4

       

      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Unlimited currents
      - Vip lv 15
      - Unlimited point upgrade
      - Feed max
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 71 replies
    • Adorimon: Arena of Ancient v1.3.568 Cheats +4
      Modded/Hacked App: Adorimon: Arena of Ancient By Mai Duc
      Bundle ID: com.ubiplay.petfi.adorimon
      iTunes Store Link: https://apps.apple.com/us/app/adorimon-arena-of-ancient/id6443480229?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Unlimited currents
      - Vip lv 15
      - Unlimited point upgrade
      - Feed max
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 110 replies
    • Fashion Universe v1.9 Cheats +2
      Modded/Hacked App: Fashion Universe By Voodoo
      Bundle ID: com.hypnocatstudio.fashionuniverse
      iTunes Store Link: https://apps.apple.com/us/app/fashion-universe/id1597104322?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Premium: Setting -> Vibration -> Float icon -> In-App Purchase -> VoodooPremium
      - Unlimited currency
        • Informative
      • 0 replies
    • Fashion Universe v1.9 Cheats +2
      Modded/Hacked App: Fashion Universe By Voodoo
      Bundle ID: com.hypnocatstudio.fashionuniverse
      iTunes Store Link: https://apps.apple.com/us/app/fashion-universe/id1597104322?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Premium: Setting -> Vibration -> Float icon -> In-App Purchase -> VoodooPremium
      - Unlimited currency
      • 0 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines