Valhalla Legends Forums Archive | Battle.net Bot Development | Help Please

AuthorMessageTime
Forged
I am a noob and for some reason my bot hates me and won't send my idle. Can someone please help?

[code]
Private Sub idle_Timer()
Dim strIdles As String
Dim IdleWait As Integer
Dim Idlemsg As String
Dim strIdleType As String


strIdles = ReadINI(f, "Idles", p)
strIdleType = ReadINI(f, "IdleType", p)
IdleWait = ReadINI(f, "IdleWait", p)
Idlemsg = ReadINI(f, "IdleMsg", p)

idle.Interval = CInt(IdleWait * 1000)
if If strIdles = "y" Then

If strIdleType = "mp3" Then

ExEasy1.Send "Now Playing: Vile`Chat v(1.2) By:Forged"

ElseIf strIdleType = "msg" Then ExEasy1.Send Idlemsg

ElseIf strIdleType = "uptime" Then ExEasy1.Send "System Uptime - " & ConvertTime(GetTickCount()) & " Vile`Chat (1.04)"
End If
end if
End Sub

Private Sub txtSend_KeyPress(KeyAscii As Integer)
Dim Message As String
If KeyAscii = 13 Then
ExEasy1.Send txtSend.Text
Message = txtSend.Text
txtSend.Text = ""
KeyAscii = 0
ExEasy1.AddChat vbYellow, "<", vbGreen, ExEasy1.CurrentUser, vbYellow, ">", vbWhite, Message

'Don't know if this is why
idle.Enabled = False
idle.Enabled = True

End If
End Sub[/code]
May 5, 2004, 2:16 AM
CrAz3D
[code]'Don't know if this is why
idle.Enabled = False
idle.Enabled = True[/code]
That is resetting the idle...which probably isn't too good if you ever want it to "fire"
May 5, 2004, 7:08 PM
Eli_1
[quote author=CrAz3D link=board=17;threadid=6667;start=0#msg58682 date=1083784107]
[code]'Don't know if this is why
idle.Enabled = False
idle.Enabled = True[/code]
That is resetting the idle...which probably isn't too good if you ever want it to "fire"
[/quote]
If the user is truly idle (afk), then that shouldn't be a problem.

Edit:
I've never seen anyone use this before. But who knows, it might work -- VB allows tons of weird things...
[code]
if If strIdles = "y" Then
[/code]
May 5, 2004, 7:44 PM
hismajesty
No, two consecutive if's would cause an error (expected expression) perhaps he meant to use iif()?

Edit: Typo
May 5, 2004, 8:05 PM
BaDDBLooD
what does iif function do?
May 5, 2004, 8:24 PM
Eli_1
[quote author=BaDDBLooD link=board=17;threadid=6667;start=0#msg58699 date=1083788648]
what does iif function do?
[/quote]

IIRC, the syntax is: iif(Statment, True, False)
[code]
Dim iTest As Integer
iTest = 1
MsgBox IIf(iTest = 1, "It's equal to 1!", "It's not equal to 1!"), vbOKOnly + vbInformation, "IIF Example"




'// Or maybe a bot example? ;D
Public Function GetAccess(ByVal Username as String)
GetAccess = IIF(Username = "Eli_1", 100, 0)
End Function
[/code]
May 5, 2004, 8:25 PM
Forged
I re-wrote my idletimer in math class because I was bored and it works now.
I forgot to add idle.enbaled = true

[code]
Private Sub idle_Timer()
Dim strIdles As String
Dim IdleWait As Integer
Dim Idlemsg As String
Dim strIdleType As String


strIdles = ReadINI(f, "Idles", p)
strIdleType = ReadINI(f, "IdleType", p)
IdleWait = ReadINI(f, "IdleWait", p)
Idlemsg = ReadINI(f, "IdleMsg", p)


If strIdles = "y" Then idle.Enabled = True

If strIdleType = "mp3" Then
Dim WindowTitle As String
WindowTitle = l_winamp.GetWindowTitle("Winamp v1.x")
WindowTitle = Left(WindowTitle, Len(WindowTitle) - 9)

ExEasy1.Send "Now Playing: " & WindowTitle & " Vile`Chat v(1.2) By:Forged"
ExEasy1.Chat True, True, vbYellow, "Now Playing: " & WindowTitle & " Vile`Chat v(1.2) By:Forged"

ElseIf strIdleType = "msg" Then ExEasy1.Send Idlemsg
ExEasy1.Chat True, True, vbYellow, Idlemsg
ElseIf strIdleType = "uptime" Then ExEasy1.Send "System Uptime - " & ConvertTime(GetTickCount()) & " Vile`Chat (1.2)"
ExEasy1.Chat True, True, vbYellow, "System Uptime - " & ConvertTime(GetTickCount()) & " Vile`Chat (1.2)"
End If


End Sub
[/code]
May 5, 2004, 11:52 PM
Eli_1
Haha, math and chemistry is where I write my best code.

Ironicly it's where I catch up on my sleep too. ;D
May 6, 2004, 1:28 AM
Null
Dont hardcode your versions (App.Major/Minor/Revision)

Hope that helps you a little.
May 6, 2004, 2:01 AM
Myndfyr
[quote author=Forged link=board=17;threadid=6667;start=0#msg58730 date=1083801159]
I forgot to add idle.enbaled = true
[/quote]

Don't you mean idle.enbalmed?
May 6, 2004, 2:08 AM
Forged
Sorry I spelt it wrong

idle.Enabled

......
May 6, 2004, 3:29 AM

Search