Register for your free account! | Forgot your password?

You last visited: Today at 17:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Wiederverwendbare function [Java/Metin2]

Discussion on Wiederverwendbare function [Java/Metin2] within the Metin2 PServer Designs, Websites & Scripts forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2019
Posts: 1
Received Thanks: 3
Wiederverwendbare function [Java/Metin2]

Hier eine kleine java function für metin2. Sie macht, dass man gleiche dinge wiederholt ausführen kann.

Code:
class ArrowFunction {

    constructor (thisArg) {
        this.thisArg = thisArg;
    }

    // Creates arrow function
    static create(thisArg) {
        return new this(thisArg) 
    }

    function(func) {
        this.func = func;

        return this;
    }
    
    execute(...args) {
        if (typeof this.func === 'function') {
            this.func.apply(this.thisArg, args);
        }

        return this;
    }
}
How to use it?

Code:
ArrowFunction
    .create(this)
    .function(function (text) {
        console.log(`Text: ${text}`);
    })
    .execute('ein simpler Text')
    .execute('noch einmal');

Die Ausgabe ist dann:

Text: ein simpler Text
Text: noch einmal

Die funktion wurde mir vor paar monaten verkauft, ich kann leider nicht viel damit anfangen, da ich selber nicht der experte in sachen coding bin, deshalb teile ich sie hier mit euch. Alles ist so aufgebaut, dass jemand der gut coden kann es modular erweitern kann und expandieren.

Ich hoffe habt spass damit
sebastianm2001 is offline  
Thanks
3 Users
Old 07/16/2019, 17:19   #2

 
.xCl4w'™'s Avatar
 
elite*gold: 84
Join Date: Dec 2010
Posts: 832
Received Thanks: 404
Danke dir!
.xCl4w'™ is offline  
Reply


Similar Threads Similar Threads
std::function of a function returning an std::function
11/11/2013 - C/C++ - 19 Replies
Nun muss ich nach langer Zeit auch mal wieder einen Thread erstellen, weil mir Google nicht mehr weiterhelfen kann. Ich verzweifle an Folgendem Vorhaben: #include <Windows.h> #include <string> #include <iostream> using namespace std;
Running Function 2 after Function 1 finished
09/15/2013 - AutoIt - 3 Replies
Hey, its me again. Im stuck on a problem since yesterday and as much as i hate to ask for help, i really dont know what else to try. I want Function 2 to run after Function 1 has finished. I tried GuiCtrlSetOnEvent and MsgLoop, but i dont really understand it. I tried to read tutorials but they didnt help at all. The line that are underline is what im talking about. I want gamestart() to run first and when its finished, i want iniviteteam() to run. #AutoIt3Wrapper_UseX64=n...
[VIP-function] ToxicSYS [VIP-function]
08/14/2010 - WarRock Hacks, Bots, Cheats & Exploits - 1 Replies
heeeey E-pvpers :pimp: this is a new hack by TSYS Status : UNDETECTED Functions (VIDEO) : YouTube - WarRock - Bikini event VIP hack



All times are GMT +1. The time now is 17:12.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.