Valhalla Legends Forums Archive | Battle.net Bot Development | Whats wrong with this....?

AuthorMessageTime
OuTLawZGoSu
[code]
'Volume Set
'
If username = LoadMaster Then
If Left((LCase(message)), 7) = (LoadTrigger & "setvol") Then
WindowTitle = GetWindowTitle("Winamp v1.x")
If WindowTitle = "" Then
CmdQueue " ::.. Winamp not Loaded"
Else
WinAMP_SetVolume (Mid(message, 7, Len(message) - 1))
CmdQueue " ..:: Volume set to: [ "
End If
End If
End If
[/code]

When I type " .setvol 20 " ( or wat ever number) the command doese'nt even respond. I got this to work with a Inputbox, but can't get it as a remote command.

Help?
January 9, 2004, 11:49 PM
Adron
Add some debug output or set some breakpoints. Do you ever get to those lines? What's LoadMaster set to? That kind of things...
January 10, 2004, 12:07 AM
OuTLawZGoSu
[quote author=Adron link=board=17;threadid=4668;start=0#msg39094 date=1073693274]
Add some debug output or set some breakpoints. Do you ever get to those lines? What's LoadMaster set to? That kind of things...
[/quote]

- Not sure what you mean by debug output, breakpoints.
- What you mean by, "Do you ever get to those lines?"
- Loadmaster = Getstuff("Config","Master")
January 11, 2004, 12:47 AM
UserLoser.
[quote author=OuTLawZGoSu link=board=17;threadid=4668;start=0#msg39203 date=1073782054]
[quote author=Adron link=board=17;threadid=4668;start=0#msg39094 date=1073693274]
Add some debug output or set some breakpoints. Do you ever get to those lines? What's LoadMaster set to? That kind of things...
[/quote]

- Not sure what you mean by debug output, breakpoints.
- What you mean by, "Do you ever get to those lines?"
- Loadmaster = Getstuff("Config","Master")
[/quote]

Getstuff()?
January 11, 2004, 1:29 AM
Crypticflare
I believe thats a similar function to Ickis's read/write INI procedure.
January 11, 2004, 1:50 AM
OuTLawZGoSu
GetStuff gets specific text from a INI file.

January 11, 2004, 2:39 AM
OuTLawZGoSu
Fixed ;D

[code]
'Volume Set
'
If username = wLoadMaster Then
If Left((LCase(message)), 7) = (wLoadTrigger & "setvol") Then
WindowTitle = GetWindowTitle("Winamp v1.x")
If WindowTitle = "" Then
CmdQueue " ::.. Winamp not Loaded"
Else
WinAMP_SetVolume ((Mid(message, 8, Len(message) - 2)))
CmdQueue " ..:: Volume set to: [" & (Mid(message, 8, Len(message) - 2)) & " ] "
End If
End If
End If
[/code]

Looks sloppy :/
January 11, 2004, 3:17 AM
Adron
[quote author=OuTLawZGoSu link=board=17;threadid=4668;start=0#msg39203 date=1073782054]

- Not sure what you mean by debug output, breakpoints.
- What you mean by, "Do you ever get to those lines?"
- Loadmaster = Getstuff("Config","Master")
[/quote]

I meant something like this:

[code]
'Volume Set
'
Debug.Print "username: """ & username & """, LoadMaster: """ & LoadMaster & """"
If username = LoadMaster Then
Debug.Print "message: """ & message & """, trigger: """ & LoadTrigger & "setvol"""
If Left((LCase(message)), 7) = (LoadTrigger & "setvol") Then
WindowTitle = GetWindowTitle("Winamp v1.x")
If WindowTitle = "" Then
CmdQueue " ::.. Winamp not Loaded"
Else
WinAMP_SetVolume (Mid(message, 7, Len(message) - 1))
CmdQueue " ..:: Volume set to: [ "
End If
End If
End If
[/code]


Add to that some breakpoints so you can step through the code and check all values, and finding the problem should be a piece of cake.

Now, since you already found the problem, what was it? A case of using uninitialized, undeclared variables without Option Explicit, so you loaded the values into one set of variables and used another?
January 11, 2004, 1:57 PM
OuTLawZGoSu
The problem was this " WinAMP_SetVolume ((Mid(message, 8, Len(message) - 2))) "

I set the numbers wrong. Thats why when Type in , Setvol 20 , the bot read it as, "etvol 20" . Thats why the command wouldnt execute right.

And thx for the debug thing.
January 11, 2004, 4:28 PM
MesiaH
for future info, when your in the vb6 ide, before you test your program or run it, you can click on the left hand side of the code, to create a red dot, which highlights that line of code in red, then when you execute the program, it will pause on that line of code, and you will be able to hover your mouse over variables, and do other tests to help you figure out what is actually happening, and what is going wrong. this is called setting a breakpoint and stepping through the code. quite useful..
January 11, 2004, 8:26 PM
Newby
[quote author=MesiaH link=board=17;threadid=4668;start=0#msg39299 date=1073852814]
for future info, when your in the vb6 ide, before you test your program or run it, you can click on the left hand side of the code, to create a red dot, which highlights that line of code in red, then when you execute the program, it will pause on that line of code, and you will be able to hover your mouse over variables, and do other tests to help you figure out what is actually happening, and what is going wrong. this is called setting a breakpoint and stepping through the code. quite useful..
[/quote]

Hotkey: F9 :)
January 11, 2004, 9:48 PM
R.a.B.B.i.T
[quote author=OuTLawZGoSu link=board=17;threadid=4668;start=0#msg39082 date=1073692176]
[code]
'Volume Set
'
If username = LoadMaster Then
If Left((LCase(message)), 7) = (LoadTrigger & "setvol") Then
WindowTitle = GetWindowTitle("Winamp v1.x")
If WindowTitle = "" Then
CmdQueue " ::.. Winamp not Loaded"
Else
WinAMP_SetVolume (Mid(message, 7, Len(message) - 1))
CmdQueue " ..:: Volume set to: [ "
End If
End If
End If
[/code]

When I type " .setvol 20 " ( or wat ever number) the command doese'nt even respond. I got this to work with a Inputbox, but can't get it as a remote command.

Help?
[/quote]

You need to use 'If FindWinamp = 1 Then' for it to work.
January 20, 2004, 2:25 AM
ObsidianWolf
[quote author=OuTLawZGoSu link=board=17;threadid=4668;start=0#msg39212 date=1073788774]
GetStuff gets specific text from a INI file.


[/quote]

GetStuff is a function which references to the GetPrivateProfileString API. Ive seen in a dozen sources. It by far not the most efficent way of doing things.
January 20, 2004, 8:17 PM
DarkMinion
[quote]GetStuff is a function which references to the GetPrivateProfileString API. Ive seen in a dozen sources. It by far not the most efficent way of doing things. [/quote]

In other words, it gets specific text from an INI file.
January 20, 2004, 8:45 PM

Search