[Tutorial] Using conditional checks

Talk about dragonfable and download the PKDF trainer.

Moderator: Game ID Team

[Tutorial] Using conditional checks

Postby Pkdude on August 4th, 2009, 9:03 am

This tutorial will show you how to add conditional checks in your swf projects so things won't just happen all at once.

NOTE: If you don't know how to create swf projects this isn't the guide for you.

IF functions help you trigger events(vars) at a certain time, when a goal is acheived.
e.g
If a quest is completed(goal) then the quest finish screen pops up(event).

So a typical conditional check will look like this:
Code: Select all
            if (objTarget.status == "SUCCESS")
            {
                _root.character.origStats.intStr = 0;
                _root.character.origStats.intInt = 0;
                _root.character.origStats.intDex = 0;
                _root.character.origStats.intEnd = 0;
                _root.character.origStats.intLuk = 0;
                _root.character.origStats.intCha = 0;
                _root.conn.subtractMoney(2, 1000);
                _root.game.player.resetStats();
                _root.game.player.refreshStatusBar();
            } // end if


This script is saying if you reached the status object SUCCESS then the events below will be triggered.
Code: Select all
reseting all your stats to 0
subtracts money from your gold amount
refresh your stats
refresh your status bar


as you can see this is the code for untrain all stats
So if you want to put this in a trainer then extract the useful vars:
Code: Select all
       _root.character.origStats.intStr = 0;
                _root.character.origStats.intInt = 0;
                _root.character.origStats.intDex = 0;
                _root.character.origStats.intEnd = 0;
                _root.character.origStats.intLuk = 0;
                _root.character.origStats.intCha = 0;


remove the _root part and viola, you have just successfully extracted a variable.


But you still need to learn how to use conditional checks, here is the format:

Code: Select all
if (condition here,trigger)
{
the event here
}// end if(commands end of conditional check)


I use a lot of conditional checks in both PKDF and PKMQ(e.g in the load shop buttons I need to use the conditional check on release) they can prove very useful and will get you VERY far in trainer making.
TOP Runescape Guides
Runescape F2P gold Guide
Fist of Guthix Guide
Runescape PvP Guide
Guide to 99 Prayer

______________________________________________
To download the highest versions of PKDF and PKMQ become a VIP!
Click here to find out how!

Image
You like Pkdude Games?I like donations.Donate now:

Pkdude's stats:
ATK(Attack) = 29
DEF(Defence) = 16
STA(Stamina) = 14
LUK(Luck) = 14
Item Shelf
User avatar
Pkdude
PK Admin
PK Admin
 
Posts: 2220
PKDG Gold: 4055
Donate
Joined: February 20th, 2008, 4:30 pm
Location: The hood
Highscores: 4
Favorite Style: PK Ultimate
How'd you find us: I created this site!
Reputation: 70

Re: [Tutorial] Using conditional checks

Postby J-Spill on August 28th, 2009, 11:50 pm

very helpful thanx PKDude
Image
Image
Item Shelf
User avatar
J-Spill
Forum Staff
Forum Staff
 
Posts: 942
PKDG Gold: 23186
Donate
Joined: June 26th, 2009, 12:57 am
Location: At home, hackin you
Favorite Style: PKU Black
How'd you find us: youtube
Reputation: 31

Re: [Tutorial] Using conditional checks

Postby Pkdude on August 29th, 2009, 8:54 am

Aye, but since hackers want to load an instance or function right away
conditional checks are rarely used.
unless you are coding a whole entire action script.
Which I did on the flash start button.
TOP Runescape Guides
Runescape F2P gold Guide
Fist of Guthix Guide
Runescape PvP Guide
Guide to 99 Prayer

______________________________________________
To download the highest versions of PKDF and PKMQ become a VIP!
Click here to find out how!

Image
You like Pkdude Games?I like donations.Donate now:

Pkdude's stats:
ATK(Attack) = 29
DEF(Defence) = 16
STA(Stamina) = 14
LUK(Luck) = 14
Item Shelf
User avatar
Pkdude
PK Admin
PK Admin
 
Posts: 2220
PKDG Gold: 4055
Donate
Joined: February 20th, 2008, 4:30 pm
Location: The hood
Highscores: 4
Favorite Style: PK Ultimate
How'd you find us: I created this site!
Reputation: 70

Re: [Tutorial] Using conditional checks

Postby sparkedy on September 5th, 2009, 10:34 am

are these for when you make a trainer if they are could ya give the the url to make me own trainer
sparkedy
VIP
VIP
 
Posts: 32
PKDG Gold: 5
Donate
Joined: August 29th, 2009, 3:15 pm
How'd you find us: looking for trainers
Reputation: 0

Re: [Tutorial] Using conditional checks

Postby Pkdude on September 5th, 2009, 10:37 am

Yes this is for making a trainer.
and to learn how to make your own look in dragonfable trainers and tutorials.
TOP Runescape Guides
Runescape F2P gold Guide
Fist of Guthix Guide
Runescape PvP Guide
Guide to 99 Prayer

______________________________________________
To download the highest versions of PKDF and PKMQ become a VIP!
Click here to find out how!

Image
You like Pkdude Games?I like donations.Donate now:

Pkdude's stats:
ATK(Attack) = 29
DEF(Defence) = 16
STA(Stamina) = 14
LUK(Luck) = 14
Item Shelf
User avatar
Pkdude
PK Admin
PK Admin
 
Posts: 2220
PKDG Gold: 4055
Donate
Joined: February 20th, 2008, 4:30 pm
Location: The hood
Highscores: 4
Favorite Style: PK Ultimate
How'd you find us: I created this site!
Reputation: 70


Return to Dragonfable

Who is online

Users browsing this forum: MSN [Bot] and 0 guests