• Welcome to Valhalla Legends Archive.
 

idle msg

Started by Crim-Training, October 08, 2003, 07:19 PM

Previous topic - Next topic

Crim-Training

i know this has been answered before, but i have been searching the forum and cant find it..

anyway i just need a quick idle message for a vb bot,

thx, Daniel

Yoni

Building a binary Battle.net bot in a cumbersome language such as VB requires great expertise. Surely after accomplishing this feat you can manage a mind-boggingly trivial objective consisting of nothing more than a timer and a line or two of code?

hismajesty

#2
Quote from: Crim-Training on October 08, 2003, 07:19 PM
i know this has been answered before, but i have been searching the forum and cant find it..

anyway i just need a quick idle message for a vb bot,

thx, Daniel

Hmm, heres a good idle message - "Omg hismajesty is the coolest guy ever he rox0rs my box0rs" good eh?  ;D

Edit: Oh Oh Oh...you wanted code. Well assuming you're using VB place a timer on your form and name it tmrIdle. The double click on tmrIdle which will bring up the code screen for the timer.

Then you may or may not want to reset the timer. In this example we will set the timer to a preset time. You can alter this to have it send the timer at an interval of your choice. OK

tmrIdle.Interval = "60000" '1 Minute
'This Sets The Interval


Then the idle code is this (you will need to change send to your send method, such as adding to a queue or Something.Send etc.) Also let strIdleMsg = your textbox that includes the idle message you want (Example Form2.txtIdle.text or something)


Send strIdleMsg & " ~[ YourBot By SomeLeetGuy ]~"


A full code would be like this (let strIdleOn equal a checkbox on the setup form checking if idles are enabled)


Private Sub tmrIdle_Timer()

Dim strIdleMsg As String 'Declare Variable
Dim strIdleOn As String 'Declare Variable
strIdleMsg = frmSetup.txtIdleMsg.text 'Set Variable Value
strIdleOn = frmSetup.txtIdleOn.Value 'Set Variable Value

If strIdleOn = vbChecked Then ' If the Checkbox is checked
   tmrIdle.Interval = 60000 'Set The Interval To 1 Minute
   Send strIdleMsg & " ~[ YourBot By SomeLeetGuy ]~" 'Send Idle Message Text
   End If
End Sub

Stealth

Or.. much more simply, and without declaring two unnecessary variables:


Private Sub tmrIdle_Timer()
    If frmSetup.txtIdleOn.Value = vbChecked Then ' If the Checkbox is checked
        tmrIdle.Interval = 60000 'Set The Interval To 1 Minute
        Send frmSetup.txtIdleMsg.text & " ~[ YourBot By SomeLeetGuy ]~" 'Send Idle Message Text
    End If
End Sub
- Stealth
Author of StealthBot

hismajesty

Quote from: Stealth on October 08, 2003, 10:00 PM
Or.. much more simply, and without declaring two unnecessary variables:


Private Sub tmrIdle_Timer()
    If frmSetup.txtIdleOn.Value = vbChecked Then ' If the Checkbox is checked
        tmrIdle.Interval = 60000 'Set The Interval To 1 Minute
        Send frmSetup.txtIdleMsg.text & " ~[ YourBot By SomeLeetGuy ]~" 'Send Idle Message Text
    End If
End Sub


I figured he'd be able to tell the variables are not required...I don't use variables within my code but I thought maybe if he didn't know how to declare variables that it would help.

Grok

Quote from: hismajesty on October 08, 2003, 10:06 PMI figured he'd be able to tell the variables are not required...I don't use variables within my code but I thought maybe if he didn't know how to declare variables that it would help.

Yes, variables are overrated.

Zakath

Variables? Who needs variables? Or functions, for that matter. My last bot was just a big list of mathematical operations involving numeric constants. I didn't even use a single string!
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

hismajesty

Quote from: Zakath on October 09, 2003, 01:02 PM
Variables? Who needs variables? Or functions, for that matter. My last bot was just a big list of mathematical operations involving numeric constants. I didn't even use a single string!

Math sucks.

UserLoser

#8
Much simpler, better, and non-gayer.

lTimerID = SetTimer(frmBot.hwnd, 0, 60000, AddressOf TimerProc)

Set the timer to 60 seconds.


Public Sub TimerProc(ByVal hwnd As Long, ByVal lMsg As Long, ByVal lTimerId As Long, ByVal lTime As Long)
    QueueChatMessage "Hello world!"
End Sub


Timer's callback function.

Also, make sure you kill the timer.


Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long

Stealth

Quote from: Grok on October 09, 2003, 12:14 PM
Quote from: hismajesty on October 08, 2003, 10:06 PMI figured he'd be able to tell the variables are not required...I don't use variables within my code but I thought maybe if he didn't know how to declare variables that it would help.

Yes, variables are overrated.

It would seem that, unless he were making modifications to the contents of those two text boxes or using them extensively before sending them to Battle.net, there's no reason to create individual variables to mirror their contents. Is my thinking wrong?
- Stealth
Author of StealthBot

hismajesty


iago

Quote from: hismajesty on October 09, 2003, 04:33 PM
Quote from: Stealth on October 09, 2003, 04:04 PM
Is my thinking wrong?

Is it ever?  :P

Well yeah, an example would be putting vL's homechannel on StealthBot's channel list :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


hismajesty

#12
Quote from: iago on October 09, 2003, 04:58 PM
Quote from: hismajesty on October 09, 2003, 04:33 PM
Quote from: Stealth on October 09, 2003, 04:04 PM
Is my thinking wrong?

Is it ever?  :P

Well yeah, an example would be putting vL's homechannel on StealthBot's channel list :)

It wouldn't make a difference seeing as 3/4 of bnet is banned from [vL] anyway.  :P

iago

Quote from: hismajesty on October 09, 2003, 06:21 PM
Quote from: iago on October 09, 2003, 04:58 PM
Quote from: hismajesty on October 09, 2003, 04:33 PM
Quote from: Stealth on October 09, 2003, 04:04 PM
Is my thinking wrong?

Is it ever?  :P

Well yeah, an example would be putting vL's homechannel on StealthBot's channel list :)

It wouldn't make a difference seeing as 3/4 of bnet is banned from [vL] anyway.  :P

eewy spam, mostly.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


hismajesty

#14
Quote from: iago on October 09, 2003, 08:07 PM
Quote from: hismajesty on October 09, 2003, 06:21 PM
Quote from: iago on October 09, 2003, 04:58 PM
Quote from: hismajesty on October 09, 2003, 04:33 PM
Quote from: Stealth on October 09, 2003, 04:04 PM
Is my thinking wrong?

Is it ever?  :P

Well yeah, an example would be putting vL's homechannel on StealthBot's channel list :)

It wouldn't make a difference seeing as 3/4 of bnet is banned from [vL] anyway.  :P

eewy spam, mostly.

How dare you call me a spammer?  :'(

Edit: This topic has really gotten off topic.  ;D