| View previous topic :: View next topic |
| Author |
Message |
_NoX_ Master Cheater
Reputation: 0
Joined: 17 Feb 2009 Posts: 471 Location: UK
|
Posted: Wed May 20, 2009 5:42 am Post subject: Getting variable and displaying in vb 2008 |
|
|
hell, this may be a very simple open and shut problem. Im making trainer and want to display variables from the swf i load, i thought it would be the same as setting variables but instead of editing with a text box the variable will be displayed in it, unfortunately its not . im looking for a straight forward answer and obviously an example if possible.
cheers in advance
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed May 20, 2009 5:56 am Post subject: Re: Getting variable and displaying in vb 2008 |
|
|
| xjohnnox wrote: | hell, this may be a very simple open and shut problem. Im making trainer and want to display variables from the swf i load, i thought it would be the same as setting variables but instead of editing with a text box the variable will be displayed in it, unfortunately its not . im looking for a straight forward answer and obviously an example if possible.
cheers in advance |
Instead of using SetVariable you use GetVariable it takes a string as argument and then returns a string value.
so you can like do
| Code: | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = AxShockwaveFlash1.GetVariable("Score")
End Sub |
If the variable doesn't exist then it will throw an exception. So you can add some nice error handleing
| Code: | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Label1.Text = AxShockwaveFlash1.GetVariable("blah")
Catch c As System.Runtime.InteropServices.COMException
MessageBox.Show("the variable does not exist")
End Try
End Sub |
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Wed May 20, 2009 7:42 am Post subject: |
|
|
since it crash when variables doent exist you should always use it with
On Error Resume next
because usually variables dont exist when not used
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed May 20, 2009 7:49 am Post subject: |
|
|
| Epic Cat Garfield wrote: | since it crash when variables doent exist you should always use it with
On Error Resume next
because usually variables dont exist when not used |
Can you use on error with a label? Like
| Code: | | On Error Go To ErrorHandeler |
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Wed May 20, 2009 12:00 pm Post subject: |
|
|
yes, but you have to make sure errhandler is only called when err comes up
like
if 1=2 then
:errhandles
...
end if
_________________
|
|
| Back to top |
|
 |
_NoX_ Master Cheater
Reputation: 0
Joined: 17 Feb 2009 Posts: 471 Location: UK
|
Posted: Wed May 20, 2009 4:29 pm Post subject: |
|
|
oh so u dstart with where u want the value to appear before u ask for the var, ty for the help guys, much appreciated
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Wed May 20, 2009 5:03 pm Post subject: |
|
|
| xjohnnox wrote: | | oh so u dstart with where u want the value to appear before u ask for the var, ty for the help guys, much appreciated |
Yes. The property that you want to assign a new value for is placed left to the equal sign and the value is placed to the right.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Wed May 20, 2009 5:22 pm Post subject: |
|
|
| Epic Cat Garfield wrote: | since it crash when variables doent exist you should always use it with
On Error Resume next
because usually variables dont exist when not used |
Not the best thing to do
if a error happens it just goes on next line.. it might actually mess up your hack doing that
better to do
'exits on error but u won't get any return
On Error Exit Sub
or
On Error GoTo Endd
| Code: | Function doesVariableExist(Variable$) as Boolean
On Error GoTo Endd
value$ = blahblah.GetVarible(Variable$)
doesVariableExist = True
Endd:
doesVariableExist = False
End Function |
_________________
|
|
| Back to top |
|
 |
_NoX_ Master Cheater
Reputation: 0
Joined: 17 Feb 2009 Posts: 471 Location: UK
|
Posted: Wed May 20, 2009 6:04 pm Post subject: |
|
|
well i managed to get the vars i wanted and have them displayed but now i have another problem, one of the vars i need well doesnt do what it says and i cannot locate any other that does the same job. better if i tell u what im hacking. starfighter disputed galaxy. i want it to display the total number of AI/npc ships, i have managed to display both number of REAL players and total number of ships, now i was wondering if there is no var for the total AI ships then would u be able to do a calcuation to be displayed in a label. for example:
total ships - real players
this would leave AI ships but have no idea how i would make this work
help would be appreciated
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Thu May 21, 2009 4:25 am Post subject: |
|
|
| pkedpker wrote: | | Epic Cat Garfield wrote: | since it crash when variables doent exist you should always use it with
On Error Resume next
because usually variables dont exist when not used |
Not the best thing to do
if a error happens it just goes on next line.. it might actually mess up your hack doing that
better to do
'exits on error but u won't get any return
On Error Exit Sub
or
On Error GoTo Endd
| Code: | Function doesVariableExist(Variable$) as Boolean
On Error GoTo Endd
value$ = blahblah.GetVarible(Variable$)
doesVariableExist = True
Endd:
doesVariableExist = False
End Function |
|
Or you can catch exceptions. That is also powerfull. Becuase when a program crash what's really happening is that a exception is thrown and the program isn't programmed to catch it. All operations and components are assgined exceptions. So if the exception isn't thrown there is no way for the program to crash.
| xjohnnox wrote: | well i managed to get the vars i wanted and have them displayed but now i have another problem, one of the vars i need well doesnt do what it says and i cannot locate any other that does the same job. better if i tell u what im hacking. starfighter disputed galaxy. i want it to display the total number of AI/npc ships, i have managed to display both number of REAL players and total number of ships, now i was wondering if there is no var for the total AI ships then would u be able to do a calcuation to be displayed in a label. for example:
total ships - real players
this would leave AI ships but have no idea how i would make this work
help would be appreciated |
total ships - your ships would be equal to ai ships , imo.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
_NoX_ Master Cheater
Reputation: 0
Joined: 17 Feb 2009 Posts: 471 Location: UK
|
Posted: Thu May 21, 2009 5:26 am Post subject: |
|
|
@beloved hero how would i right that in vb 2008
label1 = Label2 - Label3 ???
label1 being no of ai
label2 being no of ships
lebel3 being no of players
and also i do not know if this is in right area but i problem has just started affecting me. when i am done with a trainer for the night i click save all to save everything and then close the program. next day i click to loadit up and nothing happens, there is a slight loading delay but nothing loads, no forms nothing in the panel to the right??? this is a major problem and now i cannot edit noredoing anything with the trainer again. this is a major problem i need fixing and any answers as to why it is not loading would be much appreciated
_________________
|
|
| Back to top |
|
 |
|