News:

So the widespread use of emojis these days kinda makes forum smileys pointless, yeah?

Main Menu

AmeeVB

Started by Joe, September 19, 2005, 11:52:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe

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.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Newby

- 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

Quote from: Rule on June 30, 2008, 01:13:20 PM
Quote from: CrAz3D on June 30, 2008, 10:38:22 AM
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. 

Joe

Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Joe

#3
xar made me change the bots name on IRC. Its running as QuoteBotVB right now.

QuoteJoe: .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 -
QuoteQuoteBotVB: RTE 35764 (Still executing last request) in module modQuotes of prjAmeeVB.
RTE my Inet control please.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


rabbit

Use a socket.  Socket > (Inet * infinity plus one)

Joe

omg. Please don't plant logic bombs. =p
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Warrior

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

Joe

#7
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
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
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
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.