Jump to content

16 posts in this topic

Recommended Posts

Posted

Hello. Im making a patcher for happyWheels.

 

My tweak.xm:

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.iosgods.happyw.plist"

 

inline bool GetPrefBool(NSString *key) {

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

%hook Session

 

-(float)gravity {

if(GetPrefBool(@"key1")) {

return -5.00f;

}

return %orig;

}

 

%end

 

%hook CharacterB2D

 

-(void)headSmash:(float)argument {

if(GetPrefBool(@"key2")) {

argument = 9999999.9f;

}

return %orig;

}

 

-(void)chestSmash:(float)argument {

if(GetPrefBool(@"key2")) {

argument = 9999999.9f;

}

return %orig;

}

 

-(void)pelvisSmash:(float)argument {

if(GetPrefBool(@"key2")) {

argument = 999999.9f;

}

return %orig;

}

 

%end

 

%hook SomethingElse

 

-(BOOL)SomeMethod {

if(GetPrefBool(@"key4")) {

return TRUE;

}

return %orig;

}

 

%end

 

 

The switcher "lowGravity" works but the godmode doesn't. Im not sure if this is the right way to put more methods in one switch but when i return those values in flex, the godmode works fine. Just the godmode switch isnt gonna change anything ingame.

Please Help.

Posted

Post your preference plist also.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>items</key>

<array>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your first switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key1</string>

<key>label</key>

<string>LowGravity</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>You can only die through arrow/harpoon/spikes</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key2</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your third switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key3</string>

<key>label</key>

<string>Switch Text 3</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your fourth switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key4</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

</dict>

<dict>

<key>cell</key>

<string>PSTextCell</string>

<key>label</key>

<string>Made by axce.</string>

</dict>

<dict>

<key>action</key>

<string>link</string>

<key>cell</key>

<string>PSButtonCell</string>

<key>icon</key>

<string>[email protected]</string>

<key>label</key>

<string>Visit iOSGods.com</string>

</dict>

</array>

<key>title</key>

<string>happyw Cheats</string>

</dict>

</plist>

Try

 

-(void)headSmash:(float)argument {
if(GetPrefBool(@"key2")) {
%orig(9999999.9f);
}
return %orig;
}
for those methods :dunno:
Ill try, Thanks. And btw how can i make my for ex. Tweak.xm colorful?
Posted

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>items</key>

<array>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your first switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key1</string>

<key>label</key>

<string>LowGravity</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>You can only die through arrow/harpoon/spikes</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key2</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your third switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key3</string>

<key>label</key>

<string>Switch Text 3</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your fourth switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key4</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

</dict>

<dict>

<key>cell</key>

<string>PSTextCell</string>

<key>label</key>

<string>Made by axce.</string>

</dict>

<dict>

<key>action</key>

<string>link</string>

<key>cell</key>

<string>PSButtonCell</string>

<key>icon</key>

<string>[email protected]</string>

<key>label</key>

<string>Visit iOSGods.com</string>

</dict>

</array>

<key>title</key>

<string>happyw Cheats</string>

</dict>

</plist>

Ill try, Thanks. And btw how can i make my for ex. Tweak.xm colorful?

Use the code tag if you're trying to do what I did

Posted

Use the code tag if you're trying to do what I did

What is the tag? I coulden't find it.
Posted (edited)

Try this.

 

Tweak.xm:

 

 

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.iosgods.happyw.plist"

 

inline bool GetPrefBool(NSString *key) {

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

#include <Foundation/Foundation.h>

 

%hook Session

-(float)gravity {

if(GetPrefBool(@"key1")) {

return -5.00f;

}

return %orig;

}

%end

 

%hook CharacterB2D

-(void)headSmash:(float)argument1 {

if(GetPrefBool(@"key2")) {

argument1 = 9999999.0f;

}

return %orig;

}

%end

 

%hook CharacterB2D

-(void)chestSmash:(float)argument2 {

if(GetPrefBool(@"key2")) {

argument2 = 9999999.0f;

}

return %orig;

}

%end

 

%hook CharacterB2D

-(void)pelvisSmash:(float)argument3 {

if(GetPrefBool(@"key2")) {

argument3 = 999999.0f;

}

return %orig;

}

%end

 

%hook SomethingElse

-(BOOL)SomeMethod {

if(GetPrefBool(@"key3")) {

return TRUE;

}

return %orig;

}

%end

 

 

 

Preference Plist:

 

dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key1</string>

<key>label</key>

<string>LowGravity</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>You can only die through arrow/harpoon/spikes</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key2</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your fourth switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key3</string>

<key>label</key>

<string>GodMode</string>

</dict>

Updated by Crypto
Posted

Try this.

Tweak.xm:

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.iosgods.happyw.plist"

inline bool GetPrefBool(NSString *key) {

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

#include <Foundation/Foundation.h>

%hook Session

-(float)gravity {

if(GetPrefBool(@"key1")) {

return -5.00f;

}

return %orig;

}

%end

%hook CharacterB2D

-(void)headSmash:(float)argument1 {

if(GetPrefBool(@"key2")) {

argument1 = 9999999.0f;

}

return %orig;

}

%end

%hook CharacterB2D

-(void)chestSmash:(float)argument2 {

if(GetPrefBool(@"key2")) {

argument2 = 9999999.0f;

}

return %orig;

}

%end

%hook CharacterB2D

-(void)pelvisSmash:(float)argument3 {

if(GetPrefBool(@"key2")) {

argument3 = 999999.0f;

}

return %orig;

}

%end

%hook SomethingElse

-(BOOL)SomeMethod {

if(GetPrefBool(@"key3")) {

return TRUE;

}

return %orig;

}

%end

Preference Plist:

dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key1</string>

<key>label</key>

<string>LowGravity</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>You can only die through arrow/harpoon/spikes</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key2</string>

<key>label</key>

<string>GodMode</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>footerText</key>

<string>This text will appear under your fourth switch.</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>com.iosgods.happyw</string>

<key>key</key>

<string>key3</string>

<key>label</key>

<string>GodMode</string>

</dict>

No, still nothing. :/

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • 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