Welcome Back! Please login below. If you are not yet a member, why not register? Enjoy!
We have now opened a new Build server! IP: 188.165.193.102:27016

    AFK [E2]

    Share
    avatar
    Blizzard
    Wire Pro
    Wire Pro

    Number of posts : 334
    Age : 26
    Location : Switzerland
    In-Game Name : [BS] Blizzard

    Credits Credits :
    1 / 1001 / 100

    Warnings! Warnings! :
    0 / 100 / 10

    Registration date : 2008-11-23
    Points : 342
    Reputation : 14
    20091006

    AFK [E2]

    Post by Blizzard

    Hey guys,

    I made an E2 which tells people when you are AFK.
    It's a quick one I made today, probably took me total 1 hour with debugging.
    I think the code is pretty clean, so good for learning purposes, also it's very useful Smile

    How to use it:
    1. Spawn the E2
    2. Now, when you want to go afk, write in chat like "hey guys, i'm afk, i got to go eat". AFK doesn't have to be at the beginning or something, it will be detected automaticly. Also, you can use BRB if you want. It doesn't depend if it's lower-/uppercase, so it could be brb, or aFk, just how you like it.
    3. Now the E2 is activated, when someone will say your name, you will automaticly say that you're afk, how long you have been afk, and it tells the reason: "i got to go eat"
    4. If you're back, and you want it to shut off, just say a sentence where the word "back" is in, like: "guys, i'm back."

    The only thing you have to do to set up the E2, at the beginning (after the line "@trigger all"), you can see Key = "yournamehere". You have to replace yournamehere with your name or a part of it.
    In my case I used bliz, so if someone calls me bliz, or blizz, or blizzard, it will react. The Key has to be lowercase, else it won't work (don't worry, it will still work if someone says like BLIZZARD!). So if a lot of people use a nickname (based on your name) for your name like in my example, try to find the shortest one.

    I hope you guys like it, it's really useful. Please use it, so everybody knows where you're at ;-)

    Code:
    @name AFK [E2] by Blizzard
    @persist AFK Reason:string Minutes Seconds Beginning Time Key:string
    @trigger all
    Key = "yournamehere"
    runOnChat(1)
    interval(1000)
    if((lastSaid():lower():find("afk") | lastSaid():lower():find("brb")) & AFK == 0 & lastSpoke() == entity():owner() & chatClk()) {
            if(lastSaid():lower():find("afk")) {
                Beginning = lastSaid():lower():find("afk")
                AFK = 1
                Reason = lastSaid():sub(Beginning+4,lastSaid():length())
                Time = 0
            }
            if(lastSaid():lower():find("brb")) {
                Beginning = lastSaid():lower():find("brb")
                AFK = 1
                Reason = lastSaid():sub(Beginning+4,lastSaid():length())
                Time = 0
            }
    }
    if(AFK == 1) {
            if(clk()) {
                Time++
                Minutes = floor(Time / 60)
                Seconds = Time - (Minutes * 60)
            }
                if(chatClk() & lastSaid():lower():find(Key) > 0) {
                concmd("say Blizzard's AFK E2 - I'm AFK for "+toString(Minutes)+":"+toString(Seconds)+" minutes. Reason: "+Reason+"")
            }
        if(lastSaid():lower():find("back") > 0 & chatClk(entity():owner())) {
        timer("delay",1500)
    }
    if(clk("delay")) {
        concmd("say I'm back after "+toString(Minutes)+":"+toString(Seconds)+" minutes.")
        AFK = 0
    }
    }

    If you like it, comments please!


    _________________


    Share this post on: diggdeliciousredditstumbleuponslashdotyahoogooglelive

    avatar

    Post on Tue Oct 06, 2009 2:39 am by SedumAcre

    Nice!! Very Happy
    avatar

    Post on Tue Oct 06, 2009 2:44 am by Bam

    I could over use this XD
    avatar

    Post on Tue Oct 06, 2009 2:45 am by Blizzard

    Bam wrote:I could over use this XD

    Yes you would Very Happy lol
    Use it plz, so we know when you're afk and when you're faking it. kkthxbye Very Happy
    avatar

    Post on Tue Oct 06, 2009 2:51 am by HamNJelly

    I thought It was a longer code ingame. But its awesome
    avatar

    Post on Tue Oct 06, 2009 2:54 am by Bam

    Blizzard wrote:
    Bam wrote:I could over use this XD

    Yes you would Very Happy lol
    Use it plz, so we know when you're afk and when you're faking it. kkthxbye Very Happy

    How can you fake been afk? Just sit there looking forwards and at how shiny the psygun is? Razz
    avatar

    Post on Tue Oct 06, 2009 3:19 am by jakegadget

    Awesome. Your creations never cease to amaze me ^.^
    avatar

    Post on Tue Oct 06, 2009 3:19 am by Blizzard

    Bam wrote:
    Blizzard wrote:
    Bam wrote:I could over use this XD

    Yes you would Very Happy lol
    Use it plz, so we know when you're afk and when you're faking it. kkthxbye Very Happy

    How can you fake been afk? Just sit there looking forwards and at how shiny the psygun is? Razz

    Exactly.
    avatar

    Post on Tue Oct 06, 2009 3:20 am by Blizzard

    SedumAcre wrote:Nice!! Very Happy

    HamNJelly wrote:I thought It was a longer code ingame. But its awesome

    jakegadget wrote:Awesome. Your creations never cease to amaze me ^.^

    Thanks for the positive comments! I really appreciate that a lot!
    avatar

    Post on Tue Oct 06, 2009 6:08 pm by HikariMisako

    Awesome idea too Smile
    Will try it Very Happy
    avatar

    Post on Tue Oct 06, 2009 8:23 pm by Jacko245

    Nice one again Blizz! Your such a show off, and you dont have to attempt you teach me again. I'm English. I give up easily. And I will make that button switch on a light!
    avatar

    Post on Tue Oct 06, 2009 9:10 pm by Bam

    Jacko245 wrote:I'm English. I give up easily.

    Speak for your self english boy.
    avatar

    Post on Tue Oct 06, 2009 9:22 pm by Blizzard

    Jacko245 wrote:Nice one again Blizz! Your such a show off, and you dont have to attempt you teach me again. I'm English. I give up easily. And I will make that button switch on a light!

    I'm sure you will, just keep on doing it!
    avatar

    Post on Tue Oct 06, 2009 11:46 pm by Jacko245

    You make me sound like a freaking five year old.
    Yes thats right ladies and gentlemen, the spacker can't turn on a light.

    Post  by Sponsored content


      Current date/time is Fri Jan 18, 2019 9:04 pm