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 


Bad Coding? VB08

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

Joined: 08 Sep 2007
Posts: 408
Location: Karachi

PostPosted: Mon Jan 21, 2008 6:42 am    Post subject: Bad Coding? VB08 Reply with quote

Is this bad coding or something?

Code:
    Private Sub tmrmid_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrmid.Tick
        If AxAQ.CurrentFrame >= 81 Then
            lblmidvar.Text = AxAQ.GetVariable("_root.m.idLore_monster")
        Else
        End If
    End Sub


Here I have renamed Form2 to AQ. And AxShockwaveFlash1 to AxAQ. And Label1 to lblmidvar. And Timer1 to tmrmid.
tmrmid is enabled with interval 100 and the rest default. When the If commands are met, the program just hangs/encounters an error.

What's wrong?

_________________
XHale wrote:
Angemon102 = cool


TO DO LIST:
1) Finish and Release that God forsaken trainer
2) Update the updated VB6 Tutorial
3) Learn AAS
4) Do homework...... Damn!
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Mon Jan 21, 2008 6:49 am    Post subject: Reply with quote

I don't know VB but I think it crashes because of the GetVariable().
I think it can't get the variable because it doesn't exist.
Not sure though.
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Mon Jan 21, 2008 7:03 am    Post subject: Reply with quote

lol rEakW0n, didnt notice?
wrong section buddy uhm general programming i think

_________________
Back to top
View user's profile Send private message AIM Address
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Jan 21, 2008 7:05 am    Post subject: Reply with quote

This is general programming. Shocked
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Jan 21, 2008 7:07 am    Post subject: Reply with quote

Yes, because it's VB
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Mon Jan 21, 2008 7:10 am    Post subject: Reply with quote

lol soz dw,
i was in ms then i went to a bookmarked page that was in this section and i thought i was in ms haha soz guys

_________________
Back to top
View user's profile Send private message AIM Address
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Mon Jan 21, 2008 7:29 am    Post subject: Reply with quote

use AxAQ.FrameNum

Code:

 Try
     If AxAQ.FrameNum >= 81 Then
         llblmidvar.Text = AxAQ.GetVariable("_root.m.idLore_monster")
     End If
 Catch
     lblmidvar.Text = "error"
 End Try
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: Mon Jan 21, 2008 10:57 am    Post subject: Reply with quote

The only thing I would say that is bad coding about this is that you have an empty else case. If you are not planning to add anything to it, just remove the else.

Code:
   Private Sub tmrmid_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrmid.Tick
      If AxAQ.CurrentFrame >= 81 Then
         lblmidvar.Text = AxAQ.GetVariable("_root.m.idLore_monster")
      End If
   End Sub


Along with that, if GetVariable fails, it will error the full program and cause it to close, you should add error handling to prevent that.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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