Results 1 to 13 of 13

Thread: Script Crash Alert - Skype

  1. #1
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default Script Crash Alert - Skype

    I truly hope this is the right place for this, if it's not feel free to move it. Also, I couldn't find any threads on this through the search function, at least nothing obvious. However I can't believe it hasn't been suggested before.

    Ok, I stopped short of creating a feature suggestion because, well, I'm not even sure this is plausible. I'm wondering if it would be possible for Simba to send you an alert via Skype (or any other means) when your script crashes. I think Skype would be the easiest, I may be wrong, but henceforth whatever system utilized will be referred to as Skype in this post to avoid confusion. Here are my prelimnary brainstorm ideas...

    1. An official Simba-specific Skype account be created. There does not need to be multiple Skypes, as it would be sending the same message everytime. (Hello "yourname", your script has stopped.)
    2. There would be a procedure you could add to your scripts such as skypeCrashAlert; that would be called at any point in the script that could crash. For example:

    Code:
    if not (whateverDidntHappen) then
    skypeCrashAlert(user12345);
    players[CurrentPlayer].Logout;
    Terminatescript;
    3. The script would then phone home to somewhere, (the villavu server? idk, you guys are the devs lol) which would have access to the Skype accout. That account would then send you a message via Skype that your script has crashed.
    4. ???
    5. Profit

    Wait, what? No...

    4. You would receive the alert on your phone, because if you don't have Skype on your phone, then L2technology bro.
    5. You could then Teamviewer your computer from your phone, because if you don't have Teamviewer on your phone, then L2tech...ehh you get it.
    6. You can either reset, or take whatever steps necessary to secure your botting account until you return to your PC.

    This would be extremely useful for us suiciders/gold farmers for a couple reasons. We don't want to miss out on XP/GP, and we don't want to leave accounts logged out with resources because of the chance of a ban taking effect.

    There would be one major issue beyond the logistics of making it work, and that would be maintaining the Skype account. New users to Villavu would need to be added to the Skype account and assigned a number or code that the server would translate for specific accounts. Or it could just use Skype names. Either:

    Code:
    skypeCrashAlert(user12345);
    Or:
    Code:
    skypeCrashAlert(gunner.3788);
    Users would post to a thread with their Skype name, and any person trusted with the capability would add them to the Skype contacts list and either create a Simba-friendly number/code for them, or just add their Skype name and it's done. Access to this Skype account would need to be VERY limited, perhaps only to devs and admins for obvious reasons.

    My first plan was to use text messages to your phone, but realized there would need to be some kind of subscription service paid by Villavu for text message ability, so that's obviously out. The only other way to get a message to your phone would be through some kind of Instant Message service. Although Skype does have the ability to SMS, I believe it is a paid feature, so users would just simply need to have the Skype app on their phone.

    I believe I have covered all of the basic logistics here, but I may be missing something. The specific application logistics would need to be worked out by people far smarter than I, so I'll just leave this here.

    I do realize this may not even be possible. Scratch that, anything is POSSIBLE. I do realize this may not even be feasible, so if it's not, kindly let me know and I'll retreat to my think tank.

    What do you guys think?

  2. #2
    Join Date
    Feb 2013
    Location
    Narnia
    Posts
    615
    Mentioned
    8 Post(s)
    Quoted
    252 Post(s)

    Default

    i think @Robert was looking to do this but via text message or email a little bit ago? idk if he finished but im sure he has some pointers.

    you just rambled on and on but if i get the jist of it you want some form of message telling you that your account has been logged out or that the script has been terminated?

    View my OSR Script Repository!


    Botted to max
    Guides: How to Report Bugs to the Scripter
    ~~~~ Moved to Java. Currently Lurking ~~~~

  3. #3
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Sk1nyNerd View Post
    you just rambled on and on but if i get the jist of it you want some form of message telling you that your account has been logged out or that the script has been terminated?
    I wouldn't exactly call outlining an entire process rambling on and on. What exactly is with the internets not having an attention span longer than 2 paragraphs anyway?

    On topic though, it's good to know that this isn't impossible to do.

  4. #4
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    I wouldn't exactly call outlining an entire process rambling on and on. What exactly is with the internets not having an attention span longer than 2 paragraphs anyway?

    On topic though, it's good to know that this isn't impossible to do.
    Yea I am fairly certain someone was doing this or has done this email already. I think the first time I saw something about it there were problems with sockets or something for simba but iirc that has been fixed since then.

    I donno, Im not into this stuff but I do remember this being suggested at one point.

    E: IS this like something you were looking for?
    http://villavu.com/forum/showthread.php?t=108744
    Last edited by Hazzah; 06-06-2014 at 03:14 PM.

  5. #5
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Hazzah View Post
    E: IS this like something you were looking for?
    http://villavu.com/forum/showthread.php?t=108744
    Well there shure iz a lotsa purty colors and symbles on dat dare page...problem is I don't have any idea what any of it says. As far as I'm concerned a socket is what I plug my computer into. As I said, this would have to be worked out by people far smarter than I. I just saw a problem and thought of a solution. As for the actual implementation, I is two stoopid.

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Brandon managed to get emails working properly. It was a couple of months ago but shouldn't be too hard to find
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    If you can make simba use cmd (which is probably possible) then you could use this

    As for having Simba use cmd, if you can't do it directly you could have Simba create a batch file containing cmd command that you want sent, in this case
    Code:
    Syntax: MsgToSkype –U “Recipient Skype ID” “My message”
    You could then have Simba run the batch file, then delete the batch file to stop them cluttering things up. Or you could only have one batch file and just have Simba modify it each time.

    There's probably a cleaner way to do it though.

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Meh. Skype is slow and not open source. To be in the include... i dont think any dev would let a non open source program in. Thats why simba was created in the first place.

    Email or texts work just fine. i dont have skype on my phone. some people dont even use skype.

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Meh. Skype is slow and not open source. To be in the include... i dont think any dev would let a non open source program in. Thats why simba was created in the first place.

    Email or texts work just fine. i dont have skype on my phone. some people dont even use skype.
    I dont even have a phone smart enough to get skype on it :P

  10. #10
    Join Date
    Jul 2013
    Location
    An horse
    Posts
    300
    Mentioned
    9 Post(s)
    Quoted
    120 Post(s)

    Default

    This can be easily accomplished using email as others have said. I actually set up a two way communication system for an include I wrote for a different game that constantly checked if anyone around me talked to me. If so it would send me the contents of the message and I could text back my response. I also had it send proggies every hour and send an error message when it broke.

    Here is a link to the guide I followed to set up a php server that simba can communicate with to send and read emails. I know Brandon already made a mail function but this can read them too. Also, here is a thread where I asked some questions about it (may be helpful).

    If you are only trying to get a text when it breaks then I would suggest using what Brandon made.
    Currently lurking while messing around with dll injection. Will continue contributing after I finish my quest.

  11. #11
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Wouldn't it be easier to have your computer make a sound?
    Tsunami

  12. #12
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by xevo1 View Post
    Wouldn't it be easier to have your computer make a sound?
    Somehow I never saw this thread.. :l

    I wrote a little something out of curiosity again..
    Can be further advanced to print messages and send messages as well as many other possibilities.. Turned into a plugin, it'd be a cool toy I guess..


    C++ Code:
    /**  © 2014, Brandon T. All Rights Reserved.
      *
      *  This file is part of the SkypeHook API.
      *  SkypeHook is free software: you can redistribute it and/or modify
      *  it under the terms of the GNU General Public License as published by
      *  the Free Software Foundation, either version 3 of the License, or
      *  (at your option) any later version.
      *
      *  SkypeHook is distributed in the hope that it will be useful,
      *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      *  GNU General Public License for more details.
      *
      *  You should have received a copy of the GNU General Public License
      *  along with SkypeHook.  If not, see <http://www.gnu.org/licenses/>.
      */

    #define UNICODE
    #define _UNICODE

    #include <windows.h>
    #include <iostream>
    #include <memory>
    #include <thread>

    class SkypeAPI
    {
        private:
            HWND WindowHandle = NULL;
            HWND SkypeHandle = NULL;
            std::uint32_t Attach_ID = 0;
            std::uint32_t Discover_ID = 0;
            const wchar_t* SkypeControlAPIAttach = L"SkypeControlAPIAttach";
            const wchar_t* SkypeControlAPIDiscover = L"SkypeControlAPIDiscover";

        public:
            enum class ATTACH_STATUS : std::uint32_t
            {
                SUCCESS = 0, PENDING = 1, REFUSED = 2, UNAVAILABLE = 3, AVAILABLE = 0x8001
            };


            SkypeAPI(HWND WindowHandle);

            const std::uint32_t GetAttachedID() const {return Attach_ID;}
            const std::uint32_t GetDiscoverID() const {return Discover_ID;}

            const HWND GetSkypeHandle() const {return this->SkypeHandle;}
            void SetSkypeHandle(HWND SkypeHandle) {this->SkypeHandle = SkypeHandle;}

            bool Connect()
            {
                DWORD_PTR Result = 0;
                SendMessageTimeoutW(HWND_BROADCAST, this->Discover_ID, reinterpret_cast<WPARAM>(this->WindowHandle), 0, 0x0000, 100, &Result);
                return Result != 0;
            }
    };

    SkypeAPI::SkypeAPI(HWND WindowHandle)
    {
        this->WindowHandle = WindowHandle;
        this->Attach_ID = RegisterWindowMessageW(this->SkypeControlAPIAttach);
        this->Discover_ID = RegisterWindowMessageW(this->SkypeControlAPIDiscover);
    }

    void InitSkypeThread(HWND WindowHandle)
    {
        static std::unique_ptr<std::thread> runnable(nullptr);

        if (!runnable.get())
        {
            runnable.reset(new std::thread(&InitSkypeThread, WindowHandle));
            runnable.get()->detach();
        }
    }

    LRESULT __stdcall WindowProcedure(HWND Hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    {
        static SkypeAPI api(Hwnd);

        switch (Msg)
        {
            case WM_CREATE:
            {
                api.Connect();
            }
            break;

            case WM_COPYDATA:
            {
                if (wParam == reinterpret_cast<WPARAM>(api.GetSkypeHandle()))
                {
                    COPYDATASTRUCT* DataStruct = reinterpret_cast<COPYDATASTRUCT*>(lParam);
                    char* Response = static_cast<char*>(DataStruct->lpData);
                    std::cout<<Response<<"\n";
                    return 1;
                }
            }
            break;

            case WM_DESTROY:
                PostQuitMessage(0);
                return 0;

            default:
                if (Msg == api.GetAttachedID())
                {
                    SkypeAPI::ATTACH_STATUS status = static_cast<SkypeAPI::ATTACH_STATUS>(lParam);
                    if (status == SkypeAPI::ATTACH_STATUS::SUCCESS)
                    {
                        api.SetSkypeHandle(reinterpret_cast<HWND>(wParam));
                        std::cout<<"Connection: Successful.\n";
                    }
                    else if (status == SkypeAPI::ATTACH_STATUS::PENDING)
                    {
                        std::cout<<"Connection: Pending.\n";
                    }
                    else if (status == SkypeAPI::ATTACH_STATUS::REFUSED)
                    {
                        std::cout<<"Connection: Refused.\n";
                    }
                    else if (status == SkypeAPI::ATTACH_STATUS::UNAVAILABLE)
                    {
                        std::cout<<"Connection: Unavailable.\n";
                    }
                    else if (status == SkypeAPI::ATTACH_STATUS::AVAILABLE)
                    {
                        std::cout<<"Connection: Available.\n";
                    }
                    else
                    {
                        std::cout<<"Connection: Status-Unknown.\n";
                    }
                    return 1;
                }

                return DefWindowProcW(Hwnd, Msg, wParam, lParam);
        }
        return 0;
    }

    int InitWindow()
    {
        WNDCLASSEXW WndClass = {0};
        WndClass.cbSize = sizeof(WndClass);
        WndClass.lpfnWndProc = WindowProcedure;
        WndClass.lpszClassName = L"SkypeHook";
        WndClass.hInstance = GetModuleHandleW(nullptr);

        if(RegisterClassExW(&WndClass))
        {
            MSG Messages = {0};
            CreateWindowExW(0, L"SkypeHook", nullptr, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, HWND_MESSAGE, nullptr, GetModuleHandleW(nullptr), nullptr);

            while(true)
            {
                if (PeekMessageW(&Messages, nullptr, 0, 0, PM_REMOVE) > 0)
                {
                    if (Messages.message != WM_QUIT)
                    {
                        TranslateMessage(&Messages);
                        DispatchMessageW(&Messages);
                        continue;
                    }
                    break;
                }
                else
                {
                    Sleep(100);
                }
            }
            return Messages.wParam;
        }
        return 0;
    }

    int main()
    {
        InitWindow();
        return 0;
    }



    Last edited by Brandon; 07-04-2014 at 02:01 AM.
    I am Ggzz..
    Hackintosher

  13. #13
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Code:
    Procedure scriptCrashAlert;
    begin
    PlaySound('C:/Simba/CrashSound.wav');
    end;
    Code:
    if not (whateverDidntHappen) then
    scriptCrashAlert;
    players[CurrentPlayer].Logout;
    Terminatescript
    However, I totally like the idea of messaging you on skype because I'm constantly checking my phone and Skype
    Tsunami

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •