Outdated[K-Relay] PermaCloak

Posts 1–15 of 64 · Page 1 of 5
[K-Relay] PermaCloak


Hello.

I made PermaCloak plugin which allows you to use your cloak multiple times without cheat engine

Using this few times in short period of times will cause disconnect so I think its best to use it in something like ocean to prevent others from teleporting to you.

There is a lot of space for improvements, that is why I provide source code here.
 
Code
Code:
using Lib_K_Relay;
using Lib_K_Relay.Interface;
using Lib_K_Relay.Networking;
using Lib_K_Relay.Networking.Packets;
using Lib_K_Relay.Networking.Packets.Client;
using Lib_K_Relay.Utilities;
using System.Collections.Generic;

namespace PermaCloak
{
    public class PermaCloak : IPlugin
    {
        private bool _enabled;
        private bool galiu = true;
        private Dictionary<Client, UseItemPacket> _useItemMap = new Dictionary<Client, UseItemPacket>();
        private int TimesRepeat = 2;
        private int itemUseTime = 5500;
        public string GetAuthor()
        { return "Einaras"; }

        public string GetName()
        { return "Perma Cloak"; }

        public string GetDescription()
        { return "Automatically cloaks instantly after invisibility expires\nTo set an ammont of times that you want to cloak, use /c (number)\nType /c and Perma Clock will activate after you use your ability\n\nUsing this a lot in short period of time will most likely cause disconnect"; }

        public string[] GetCommands()
        { return new string[] { "/c", "/c (NUMBER)", "/time (ability time in milliseconds)" }; }

        public void Initialize(Proxy proxy)
        {
            proxy.ClientDisconnected += OnClientDisconnected;
            proxy.ClientConnected += OnClientConnected;
            proxy.ClientConnected += (c) => _useItemMap.Add(c, null);
            proxy.ClientDisconnected += (c) => _useItemMap.Remove(c);
            proxy.HookPacket(PacketType.USEITEM, OnUseItem);
            proxy.HookCommand("c", OnCCommand);
            proxy.HookCommand("time", onTimecommand);
        }

        private void onTimecommand(Client client, string command, string[] args)
        {
            if (args.Length == 0) return;

            int n;
            bool isNumeric = int.TryParse(args[0], out n);
            if (isNumeric)
                itemUseTime = n;           
            else 
                return;
            
            
        }

        private void OnClientConnected(Client client){galiu = true;}

        private void OnClientDisconnected(Client client){galiu = false;}

        private void OnUseItem(Client client, Packet packet)
        {
            if (client.PlayerData.Class == Classes****gue)
            {
                _useItemMap[client] = packet as UseItemPacket;
                UseItemPacket us = (UseItemPacket)packet;
                if (us.SlotObject.SlotId == 1 && _enabled)
                {
                    _enabled = false;
                   PluginUtils.Delay(itemUseTime-100, () => SendUseItem(client, 1150, 1));
                }
            }
        }



        private void OnCCommand(Client client, string command, string[] args)
        {
            if (args.Length == 0)
            {
                if (!_enabled)
                    _enabled = true;
            }
            else
            {
                int n;
                bool isNumeric = int.TryParse(args[0], out n);
                if (isNumeric)
                    TimesRepeat = n;
            }

        }

        private void SendUseItem(Client client, int i, int v)
        {
            if (galiu)
            {
                client.PreviousTime = client.PreviousTime + i;
                UseItemPacket useItem = _useItemMap[client];
                useItem.Time = client.Time;
                useItem.ItemUsePos = client.PlayerData.Pos;
                client.SendToServer(useItem);

                v++;
                if (v < TimesRepeat)
                    PluginUtils.Delay(itemUseTime-100, () => SendUseItem(client, 1150 * v, v));
            }
        }
    }
}


Since this is very unstable, I decided that I will add a command that you have to write before you use your cloak. This way you will use plugin less often which means more play time without disconnect :D (and I couldn't think of other way to make it more easy to use)

To set the amount of times you want to use your cloak over and over again, you have to write "/c (number)"
To activate permacloak, you have to write "/c" before using your cloak

Default ability time is set to 5.5 seconds. To change this, you have to write "/time (and then time in milliseconds)"

Default repeat time is 2 times.

Thanks to Kronks for K-relay and for code that I used from his AutoAbility plugin.
Thanks to @New for idea and code.

Virusⓘ scansⓘ
perma_mpgh.net (1)_mpgh.net.rar3 KB · 559 downloads Clean
Well I mean if it works for the cloak, it works for all the abilities, so it 'can' be a perma oreo for example.

So it would be better if you could set the wait time in game before using your ability again, so you can use it for others as well.

Code:
PluginUtils.Delay(itemUseTime - 100 * i, Function() SendUseItem(client, 1150 * (i - 1)))
and

Code:
Dim itemUseTime as Integer
on Initialize or (OnCComand)

Code:
proxy.HookCommand("time", AddressOf AbiTime)
Code:
Private Sub AbilityTime(client As Client, command As String, args As String())
            If args.Length = 0 Then
                'Create oryx notification or do whatever.
            Else
                Dim n As Integer
                Dim isNumeric As Boolean = Integer.TryParse(args(0), n)
                If isNumeric Then
                     = n
                End If
            End If

        End Sub
or even better make it grab the time of the current ability you are using.
Quote Originally Posted by New View Post
Well I mean if it works for the cloak, it works for all the abilities, so it 'can' be a perma oreo for example. <...>
Thanks .
Quote Originally Posted by New View Post
Well I mean if it works for the cloak, it works for all the abilities, so it 'can' be a perma oreo for example.

So it would be better if you could set the wait time in game before using your ability again, so you can use it for others as well.

Code:
PluginUtils.Delay(itemUseTime - 100 * i, Function() SendUseItem(client, 1150 * (i - 1)))
and

Code:
Dim itemUseTime as Integer
on Initialize or (OnCComand)

Code:
proxy.HookCommand("time", AddressOf AbiTime)
Code:
Private Sub AbilityTime(client As Client, command As String, args As String())
            If args.Length = 0 Then
                'Create oryx notification or do whatever.
            Else
                Dim n As Integer
                Dim isNumeric As Boolean = Integer.TryParse(args(0), n)
                If isNumeric Then
                     = n
                End If
            End If

        End Sub
or even better make it grab the time of the current ability you are using.
oreo has a longer cooldown, so you would disconnect faster ;~)
Looks safe, approved.
Quote Originally Posted by Raple View Post
Looks safe, approved.
Can you re-aprove? I fixed 2 bugs. Or @Danny or @Luis
Quote Originally Posted by Razor Sharp v2 View Post
can we get banned for this?
Yes, but why are you on MPGH if you're worrying about getting banned?
Quote Originally Posted by Alt_World View Post
Yes, but why are you on MPGH if you're worrying about getting banned?
Not ur business why I am on MPGH, I just asked if I can get banned.
Quote Originally Posted by Razor Sharp v2 View Post
Not ur business why I am on MPGH, I just asked if I can get banned.
its a hacking forum, any form of modification or external program (such as krelay) on here could get you banned.
okay am i an idiot or is krelay not working for 27.7.7?
what is krelay? I mean I want to give back to the community but I don't know how to code at all. Can someone direct me in the right direction? Please?
Do you need a good pet for this?
Jesus christ does this still work? Remember doing this like nine months ago, except back then I could just permanently be invisible and piss people off in public dungeons.

Its all fun n games until you plane into lava and cant run out because you have safewalk enabled.

Quote Originally Posted by Jeangunner View Post
Do you need a good pet for this?
Depends how long you want to be invisible.
Posts 1–15 of 64 · Page 1 of 5
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?