|
Post by AbsoluteGenius on May 20, 2003 3:16:36 GMT -5
This may seam simple but its still helpfull
These return the string thats after a given character(s)
Public Function GetAfter(sData As String, sFind As String) As String On Error Resume Next GetAfter = Mid$(sData, Locate(UCase(sData), UCase(sFind)) + Len(sFind), Len(sData)) End Function
These return the string thats before a given character(s)
Public Function GetBefore(sData As String, sFind As String) As String On Error Resume Next GetBefore = Left$(sData, Locate(sData, sFind) - 1) End Function
Both these functions use another function called Locate :-
Function Locate(sData As String, sFind As String) As Long Locate = InStr(1, sData, sFind, 1) End Function
The Locate function is just a little wrapper to simplify a function already in VB.
|
|
Trad
New Member
Posts: 1,122
|
Post by Trad on May 20, 2003 4:02:38 GMT -5
so its like $gettok for VB?
|
|
|
Post by AbsoluteGenius on May 20, 2003 5:05:36 GMT -5
I dont script so I dont know how the getok thing works
|
|
|
Post by anthrax on May 20, 2003 5:10:30 GMT -5
lot of things in mirc/vb is similar..would be good if there was some kinda tutorial vbs split(string, delimiter)(portion of string to get) is like mirc $gettok i think.. could make it exactly teh same with a few lines more of code in vb to handle errors etc i.e $gettok(hello hi hey,1,32) for mirc would return hello in vb br] split("hello hi hey", " ")(0) would return hello
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on May 20, 2003 11:46:48 GMT -5
always a favorite
Function RandomNumber(intLow As Integer, intHigh As Integer) As Integer RandomNumber = Int(Rnd * (intHigh - intLow + 1)) + intLow End Function
|
|
hacker
New Member
Banned
Posts: 7
|
Post by hacker on May 20, 2003 13:58:34 GMT -5
|
|
|
Post by KingpinX on May 20, 2003 19:53:38 GMT -5
ag we all know ur smart as hell, still most people did study kube's myth or fate code to learn how to make irc clients.... my irc client dark operations will be at a stand still for about 2-3 weeks, while i code a browser bot to help people start off on browser bots. i know how to connect easy but i was woundering... is there a way i can make a browser bot have response so the bot can talk back...?
|
|
|
Post by AbsoluteGenius on May 21, 2003 4:18:02 GMT -5
Yes using API and subclassing
you can subclass the controls in the browser and receive the messages and send messages via API
Its not an easy thing, I have a prototype bot I will be finishing off some time in the future.
Your best soloution is to look on PSC for samples on subclassing windows events
|
|
|
Post by KingpinX on May 21, 2003 14:13:29 GMT -5
thankz on the tip AG but on my multi connection irc code i am coding i am trashing it making it into browser multi connection i don't feel like typing alot....too lazy like i wanted to just make 1 connection connect the one u click like its hard for me to say kinda like so
If Tab0_Click Then then i code the connection here kinda like u did on ircdom.. i just don't like to keep making the same thing over n over
|
|