Author Topic: AmeeVB  (Read 4361 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
AmeeVB
« on: September 19, 2005, 11:52:34 pm »
A rip of xar's perl quotebot, amee. Basically, it just takes down quotes, and then coughs them back up. Right now, it stores them in an array within the bot. What I'm planning to do is store them to a file, or perhaps even write a PHP backend, and make them accessable from a webpage too. Oh yeah, its for IRC.

If you want to check it out, one is running in irc.tehnetwork.org #beta right now. Commands are..

.quote <quote to add>
.rand

EDIT -
The way its set up, it will RTE on the 1025th quote (Subscript out of range), so take it easy.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Newby

  • x86
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: AmeeVB
« Reply #1 on: September 20, 2005, 01:13:57 am »
amee owns your soul.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: AmeeVB
« Reply #2 on: September 20, 2005, 06:52:02 pm »
I'm using my PHP backend now.

http://www.javaop.com/~joe/ameevb/AmeeVB.php <-- Quotes file.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: AmeeVB
« Reply #3 on: September 20, 2005, 07:18:53 pm »
xar made me change the bots name on IRC. Its running as QuoteBotVB right now.

Quote
Joe: .quote Testing new quotes system.
QuoteBotVB: <Joe:#beta> Testing new quotes system.

Now uses the PHP backend, as I said, which shouldn't be getting clobbered with my testing crap anymore. Basically, its finished. Time to clean it up and release it.

EDIT -
Quote
QuoteBotVB: RTE 35764 (Still executing last request) in module modQuotes of prjAmeeVB.
RTE my Inet control please.
« Last Edit: September 20, 2005, 07:45:13 pm by Joe[e2] »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: AmeeVB
« Reply #4 on: September 20, 2005, 09:29:37 pm »
Use a socket.  Socket > (Inet * infinity plus one)

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: AmeeVB
« Reply #5 on: September 20, 2005, 09:45:27 pm »
omg. Please don't plant logic bombs. =p
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: AmeeVB
« Reply #6 on: September 21, 2005, 06:47:09 pm »
You set a limit on your quote array? Bad boy.

No idea if it's possible since I havn't done VB in about a month but try this:

Loading a file and parsing the quotes THEN determining the size of the array you want to make
that way you eliminate the RTE and the nasty limit.

Anyways yea, bacon.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: AmeeVB
« Reply #7 on: September 22, 2005, 12:06:05 am »
I only limited it because it was a tossed together piece of crap to show newby I could do it. Since then, I've cleaned it up.

modCommands
Code: [Select]
Option Explicit

Public Sub Command(S As String, Username As String, Channel As String)
    Dim Splt() As String: Splt() = Split(S, " ")
    Select Case Splt(0)
   
        Case modConstants.Trigger & "quote"
            Call modquotes.addQuote(Mid(S, 8), Username, Channel)
           
        Case modConstants.Trigger & "random"
            Call frmMain.sckIRC.SendData("PRIVMSG " & modConstants.Channel & " :" & modquotes.randQuote & vbCrLf)
           
        Case modConstants.Trigger & "say"
            Call frmMain.sckIRC.SendData("PRIVMSG " & modConstants.Channel & " :" & Username & ": " & Mid(S, 6) & vbCrLf)
       
    End Select
End Sub

modQuotes
Code: [Select]
Option Explicit
Public Sub addQuote(S As String, sUsername As String, sChannel As String)
    On Error GoTo addQuote_Error
    'no url for you
    Dim Quote As String: Quote = "<" & sUsername & ":" & sChannel & "> " & S
    Call frmMain.inetPHP.OpenURL("no url for you" & Encode(Quote))
    Call frmMain.sckIRC.SendData("PRIVMSG " & modConstants.Channel & " :" & sUsername & ": Quote added - " & Quote & vbCrLf)
   
    Exit Sub
addQuote_Error:
    Call frmMain.sckIRC.SendData("PRIVMSG " & modConstants.Channel & " :" _
    & "RTE " & Err.Number & " (" & Err.Description & ") in module addQuotes of prjAmeeVB." & vbCrLf)
End Sub

Public Function randQuote() As String
    On Error GoTo randQuote_Error
    Randomize
    Dim Splt() As String: Splt = Split(frmMain.inetPHP.OpenURL("http://www.javaop.com/~joe/ameevb/AmeeVB.php"), vbLf)
    randQuote = Splt(Int(Rnd * (UBound(Splt))) + 1)
   
    Exit Function
randQuote_Error:
    Call frmMain.sckIRC.SendData("PRIVMSG " & modConstants.Channel & " :" _
    & "RTE " & Err.Number & " (" & Err.Description & ") in module modQuotes of prjAmeeVB." & vbCrLf)
End Function
« Last Edit: September 22, 2005, 12:07:40 am by Joe[e2] »
I'd personally do as Joe suggests

You might be right about that, Joe.