'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
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?
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 from: Adron on January 09, 2004, 06:07 PM
Add some debug output or set some breakpoints. Do you ever get to those lines? What's LoadMaster set to? That kind of things...
- 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 from: OuTLawZGoSu on January 10, 2004, 06:47 PM
Quote from: Adron on January 09, 2004, 06:07 PM
Add some debug output or set some breakpoints. Do you ever get to those lines? What's LoadMaster set to? That kind of things...
- Not sure what you mean by debug output, breakpoints.
- What you mean by, "Do you ever get to those lines?"
- Loadmaster = Getstuff("Config","Master")
Getstuff()?
I believe thats a similar function to Ickis's read/write INI procedure.
GetStuff gets specific text from a INI file.
Fixed ;D
'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
Looks sloppy :/
Quote from: OuTLawZGoSu on January 10, 2004, 06:47 PM
- Not sure what you mean by debug output, breakpoints.
- What you mean by, "Do you ever get to those lines?"
- Loadmaster = Getstuff("Config","Master")
I meant something like this:
'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
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?
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.
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 from: MesiaH on January 11, 2004, 02:26 PM
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..
Hotkey: F9 :)
Quote from: OuTLawZGoSu on January 09, 2004, 05:49 PM
'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
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?
You need to use 'If FindWinamp = 1 Then' for it to work.
Quote from: OuTLawZGoSu on January 10, 2004, 08:39 PM
GetStuff gets specific text from a INI file.
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.
QuoteGetStuff 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.
In other words, it gets specific text from an INI file.