Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: WiLD on July 14, 2003, 10:22 AM

Title: Stalking.....
Post by: WiLD on July 14, 2003, 10:22 AM
Ok im working on a new bot. But i cant figure out how do do this 1 thing. I want it so when some1 leaves it checks whether its its master and if it is it does "/f l" (i have the bot on my friends list) and it sees what channel im in and joins it. I cant extract the name of the channel.

Plz post nething that may help thx
Title: Re:Stalking.....
Post by: Soul Taker on July 14, 2003, 10:26 AM
If the bot is using War3, just use the binary friend list to easily grab the channel.  If not, (assuming you use VB) just InStr() to 'in the channel', then do a Mid() offset by the length of 'in the channel ' and remove the trailing period.

Edit - whoops, it's 'in THE channel'
Title: Re:Stalking.....
Post by: WiLD on July 14, 2003, 10:28 AM
Oyea srr im using CSB -.-
Also an example would be great
Title: Re:Stalking.....
Post by: Soul Taker on July 14, 2003, 10:33 AM
This is off the top of my head so use at your own risk.

intStart = InStr(1, strData, "in the channel") 'strData being the incoming message
intStart = intStart + len("in the channel ") + 1 'Should offset this enough to start at the channel in the message, if not tweak it =P
strChannel = Mid(strdata, intStart) 'Grabs channel
strChannel = Mid(strChannel, 1, Len(strChannel - 1)) 'Should remove the period

Hope that gives you the idea.
Title: Re:Stalking.....
Post by: WiLD on July 14, 2003, 11:12 AM
ok thx
ill give that a try.
even though im not good at vb i think i should:
csb.send "/join " & intStart
is that correct?
Title: Re:Stalking.....
Post by: Soul Taker on July 14, 2003, 11:14 AM
No.  intStart should be an integer that simply directs the Mid() statement.  strChannel should be a string which the channel is assigned to.
Title: Re:Stalking.....
Post by: WiLD on July 14, 2003, 11:16 AM
k
lol almost 4got wat int meant.... :/

csb.send "/join " & strChannel
thats correct isnt it?
Title: Re:Stalking.....
Post by: Soul Taker on July 14, 2003, 11:19 AM
Try it and find out.  If not, debug it and see why it's not correct.  You can't learn unless you try =P
Title: Re:Stalking.....
Post by: WiLD on July 14, 2003, 11:24 AM
lol srr Nub we musta posted near da same time :/
I would try it but im very tired trying 2 finish my clan site :/

Ill try it tomorrow but thx neways

oyea u no how u can creat DHTML pages with vb6, is it the same as normal vb or is it different?
Title: Re:Stalking.....
Post by: Grok on July 14, 2003, 11:51 AM
Quote from: WiLD on July 14, 2003, 11:24 AM
oyea u no how u can creat DHTML pages with vb6, is it the same as normal vb or is it different?

Rephrase that in English, and ask it in a new thread.
Title: Re:Stalking.....
Post by: WiLD on July 15, 2003, 12:49 AM
Ok iv jus tried it,

intStart = InStr(1, strData, "in the channel") 'strData being the incoming message
intStart = intStart + len("in the channel ") + 1 'Should offset this enough to start at the channel in the message, if not tweak it =P
strChannel = Mid(strdata, intStart) 'Grabs channel
strChannel = Mid(strChannel, 1, Len(strChannel - 1)) 'Should remove the period
csb.send "/join " & strChannel


Says theres an error with strChannel do i Dim strChannel or what?
Title: Re:Stalking.....
Post by: Soul Taker on July 15, 2003, 12:50 AM
Dim strChannel as String, intStart as Integer
Title: Re:Stalking.....
Post by: WiLD on July 15, 2003, 12:54 AM
ic, asfter i posted it i tried dim strchannel  kinda got it wrong didnt i lol

soul taker you have proberly provided me with the most help ever in the on topic
Title: Re:Stalking.....
Post by: Grok on July 15, 2003, 01:05 AM
Quote from: WiLD on July 15, 2003, 12:54 AMsoul taker you have proberly provided me with the most help ever in the on topic

Oh Fear Ye Not, For Thoust Benefactor Soul Taker Will Be Punished Accord To His Deeds.


j/k