Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problem Solved

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Tue May 13, 2008 6:30 pm    Post subject: Problem Solved Reply with quote

If scanflash.GetVariable(List1.Text) = True Then
------------------------------------^
?????????????????????????????????????

I'm trying to make a variable scanner but how would I do the code so it does the getvariable method to each column on the listbox, not like a whole text. IDK what to put in :/


Last edited by coder sal on Fri May 16, 2008 10:18 am; edited 1 time in total
Back to top
View user's profile Send private message
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Tue May 13, 2008 6:56 pm    Post subject: Reply with quote

i dont know how to make it use a list but ingeneral it would be

Code:
on error resume next
anything = flash.getvariable("variable")

but then it would just say nothing if variable does not exist you would have to make on error goto..

_________________
Back to top
View user's profile Send private message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Tue May 13, 2008 6:57 pm    Post subject: Reply with quote

92Garfield wrote:
i dont know how to make it use a list but ingeneral it would be

Code:
on error resume next
anything = flash.getvariable("variable")

but then it would just say nothing if variable does not exist you would have to make on error goto..


No Shit Sherlock =.=

That's a simple GetVariable method. I'm saying if it's a list, if you don't know that then just don't answer.

Sorry for replying so rude, it's just that you stated the obvious.
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Wed May 14, 2008 12:28 am    Post subject: Reply with quote

I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
Code:
Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1;

I bet there's a better and easier way.

And remember to set i as 0, in FormCreate.


Last edited by NothingToShow on Wed May 14, 2008 12:29 am; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed May 14, 2008 12:29 am    Post subject: Reply with quote

Use List1.List(List1.ListIndex) to get the selected items text.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Wed May 14, 2008 12:52 am    Post subject: Reply with quote

Example:
Code:
    Dim i As Integer
   
    For i = 0 To List1.ListCount - 1
        If scanFlash.GetVariable(List1.List(i)) <> Nothing Then
            Call myFunc() ' or set a variable, then exit for
        End If
    Next i


I haven't programmed with the SWFlash so I'm not sure what GetVariable returns when calling a false reference. Just replace 'Nothing' with whatever is needed.
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Wed May 14, 2008 5:00 am    Post subject: Reply with quote

Moller wrote:
I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
Code:
Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1;

I bet there's a better and easier way.

And remember to set i as 0, in FormCreate.


Why would you need a timer for that? im not sure, but i think this would work:

Code:

for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]);


that would do it 99 times O.o
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Wed May 14, 2008 5:50 am    Post subject: Reply with quote

Anden100 wrote:
Moller wrote:
I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
Code:
Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1;

I bet there's a better and easier way.

And remember to set i as 0, in FormCreate.


Why would you need a timer for that? im not sure, but i think this would work:

Code:

for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]);


that would do it 99 times O.o


Lol 100 times, you forgot to include the initial index: 0.
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Wed May 14, 2008 7:46 am    Post subject: Reply with quote

Estx wrote:
Anden100 wrote:
Moller wrote:
I would do something like this, in Delphi.
Make a global var, called i as integer and then make a timer, with this in.
Code:
Flash.GetVariable(list1.Items.Strings[i]);
i := i + 1;

I bet there's a better and easier way.

And remember to set i as 0, in FormCreate.


Why would you need a timer for that? im not sure, but i think this would work:

Code:

for i:= 0 to 99 do
Flash.GetVariable(list1.Items.Strings[i]);


that would do it 99 times O.o


Lol 100 times, you forgot to include the initial index: 0.


wth! i can tell you, it aint the first time i do it O.o, i once fcked up an app, and i just couldnt figure out what was rong!
Back to top
View user's profile Send private message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Fri May 16, 2008 7:31 am    Post subject: Reply with quote

The problem is still there, please try to observe it:
http://www.speedyshare.com/283750774.html

When I start scanning instead of functioning to if the variable is correct in the shockwaveflash control it functions to the listbox, if theres something in the list or not. Please help :/
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Fri May 16, 2008 9:21 am    Post subject: Reply with quote

Code:
Private Sub Timer2_Timer()
On Error Resume Next
Dim i As Integer
   
    For i = 0 To List1.ListCount - 1
        If scanflash.GetVariable(List1.List(i)) <> "" Then
            MsgBox "ok"
              Timer2.Enabled = False
        End If
    Next i
End Sub

The loop was suggested for a command outside a timer.

If you're going to use a timer for this then add this to the top of mainvarscanform's code:
Code:
Private iPos As Integer

Then replace your old Timer2 code with the following:
Code:
Private Sub Timer2_Timer()
    If iPos > List1.ListCount Then
        iPos = 0
        Timer2.Enabled = False
    End If

    On Error GoTo SkipCheck

    If scanflash.GetVariable(List1.List(iPos)) <> "" Then
        MsgBox List1.List(iPos) & " is a valid variable"
        'Uncomment the lines below if you want to stop the timer once you've found a variable
        'iPos = 0 ' Remember to reset the value when you want to start scanning from the start again
        'Timer2.Enabled = False
    End If
   
SkipCheck:
     'If Err.Number = -2147467259 Then MsgBox List1.List(iPos) & " returned an error."
     iPos = iPos + 1
End Sub


I wont comment about the rest of your code, there's a lot that should be optimized in that - but you'll learn as you code more.
Back to top
View user's profile Send private message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Fri May 16, 2008 9:28 am    Post subject: Reply with quote

Estx wrote:
Code:
Private Sub Timer2_Timer()
On Error Resume Next
Dim i As Integer
   
    For i = 0 To List1.ListCount - 1
        If scanflash.GetVariable(List1.List(i)) <> "" Then
            MsgBox "ok"
              Timer2.Enabled = False
        End If
    Next i
End Sub

The loop was suggested for a command outside a timer.

If you're going to use a timer for this then add this to the top of mainvarscanform's code:
Code:
Private iPos As Integer

Then replace your old Timer2 code with the following:
Code:
Private Sub Timer2_Timer()
    If iPos > List1.ListCount Then
        iPos = 0
        Timer2.Enabled = False
    End If

    On Error GoTo SkipCheck

    If scanflash.GetVariable(List1.List(iPos)) <> "" Then
        MsgBox List1.List(iPos) & " is a valid variable"
        'Uncomment the lines below if you want to stop the timer once you've found a variable
        'iPos = 0 ' Remember to reset the value when you want to start scanning from the start again
        'Timer2.Enabled = False
    End If
   
SkipCheck:
     'If Err.Number = -2147467259 Then MsgBox List1.List(iPos) & " returned an error."
     iPos = iPos + 1
End Sub


I wont comment about the rest of your code, there's a lot that should be optimized in that - but you'll learn as you code more.


Wow thanks alot. You are so in the credits Very Happy
Also I'm +repping you once I get the chance.

Edit: Here's the program.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites