Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 03:54

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

Advertisement



Script Hilfe Keybind

Discussion on Script Hilfe Keybind within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1

 
Kraenk's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 445
Received Thanks: 764
Question Script Hilfe Keybind

Hallöchen ich habe ein Problem.

Ich würde gerne mein Script erweitern, bin in Sachen Programmierung eine vollkommene Niete .
Klar, die ein oder andere Sache habe ich hinbekommen, aber mit meinem vorhaben scheitere ich gerade und bitte daher hier um Hilfe.
Es geht um ein Script Addon für Chrome das sich Tampermonkey nennt.
Dort hat mir jemand ein gewünschtes Script geschrieben (Er meinte ich solle nach Javascript suchen, daher habe ich es mal als Präfix hinzugefügt, hoffe es ist richtig.), welches ich dann mit Glück etwas erweitern konnte, einfach weil ich mich noch ein wenig mit Variablen auskannte.
Das war es aber auch und nun stehe ich auf dem schlau.

Ich möchte:
Das das Script, nach dem erfolgreichen Neu Laden einer Webseite, einen Keybind ausführt.

Als Beispiel:
Heißt, das Script läuft, wartet... Event beginnt, Script führt den Reload aus (Seite lädt einmal neu), wartet paar Sekunden und drückt dann automatisch zb. STRG + ENDE.
Der Grund warum ich das möchte: Chrome erlaubt ja: Tastenkombinationen womit extension ausgelöst werden. Und genau das möchte ich damit erreichen.
Oder wäre es möglich, dass er dann ein Autohotkey-Skript ausführt? Denn das löst es auch aus.

Script Ohne Versuch:
Code:
// ==/UserScript==
(function() {
    'use strict';
    document.title = "ReloadxRecord"
    const timeToWait = 15; // in seconds
    //waits a few seconds before checking if someone is live
    setTimeout(() => {
        // only check if channel isn't already live when the script started (main use for reloading the page if live)
        if (document.querySelector('.twilight-main .live-indicator-container') === null) {
            checkIfLive();
        }
        else {
            const current = new Date();
            const time = current.toLocaleTimeString("de-DE");
            console.log("                                                                          %c�� Reload was successful  ⌛⌛ " + time + " ⌛⌛  channel is live ��","background:green;color:#fff;font-size: x-large");
        }
    }, timeToWait * 1000);

    function checkIfLive() {
        if (document.querySelector('.twilight-main .live-indicator-container') !== null) {
            //reload page because channel is live:
            location.reload();
        }
        const current = new Date();
        const time = current.toLocaleTimeString("de-DE");
        console.log("                                                                         %c�� Channel is not live  ⌛⌛ " + time + " ⌛⌛  checking again... ��","background:red;color:#fff;font-size: x-large");
        setTimeout(() => checkIfLive(), timeToWait * 1000);
    }

})();


Probiert habe ich es so, was nur nicht funktioniert :S :

Code:
// ==/UserScript==
(function() {
    'use strict';
    document.title = "ReloadxRecord"
    const timeToWait = 15; // in seconds
    //waits a few seconds before checking if someone is live
    setTimeout(() => {
        // only check if channel isn't already live when the script started (main use for reloading the page if live)
        if (document.querySelector('.twilight-main .live-indicator-container') === null) {
            checkIfLive();
        }
        else {
            const current = new Date();
            const time = current.toLocaleTimeString("de-DE");
            console.log("                                                                          %c�� Reload was successful  ⌛⌛ " + time + " ⌛⌛  channel is live ��","background:green;color:#fff;font-size: x-large");
        }
    }, timeToWait * 1000);

    function checkIfLive() {
        if (document.querySelector('.twilight-main .live-indicator-container') !== null) {
            //reload page because channel is live:
            location.reload();
        }
        const current = new Date();
        const time = current.toLocaleTimeString("de-DE");
        console.log("                                                                         %c�� Channel is not live  ⌛⌛ " + time + " ⌛⌛  checking again... ��","background:red;color:#fff;font-size: x-large");
        document.onkeyup = function(e) {
            if (e.ctrlKey && e.which == 35) {
                alert("strg+end key was pressed");
            }
        }
        setTimeout(() => checkIfLive(), timeToWait * 1000);
    }

})();

Ich hoffe mir kann jemand die richtige Lösung geben, denn wie gesagt, ich habs probiert, aber mit null Programmierungskünsten wird das wohl nix. Zumal ich Arbeiten muss und schon 2-3 Tage daran versuche :S .

Ich bedanke mich vielmals

Grüße
Kraenk is offline  
Reply


Similar Threads Similar Threads
[Selling] UD Cheap Rust Keybind Menu - Automatic Payments / Support
02/28/2021 - Rust Trading - 5 Replies
https://dynamite.wtf/store/ https://discord.gg/YcxHeTYJ6t Features + Easy Setup + EAC UD + OBS n Screenshare Proof
hypex.to or macrokingz for script pubg? I am looking for script pubg. I want script
12/26/2019 - PlayerUnknown's Battlegrounds - 6 Replies
hypex.to or macrokingz for script pubg? I am looking for script pubg. I want script . That has never been detected.
HILFE HILFE HILFE HILFE HILFE
04/28/2011 - Metin2 Private Server - 2 Replies
Hallo, Uns zwar ich habe Server Files von ComputerCrank v2. Und ich will main_quest_lv1.gotoinfomation ändern irgend wie fand ich sie nicht :( Kennt wer sich gut aus beim Computercrank v2 Server Files bitte hilft mir!. Danke.
VB 2008 - Keybind/Hotkey funktioniert nur dauerhaft?
02/25/2011 - .NET Languages - 18 Replies
Bei folgemdem Code wenn ich den Hotkey1 mit B aktiviere, so wird der definierte Text über SendKeys pausenlos immer wieder pausenlos abgesendet, jedoch reicht einmal. Wenn ichs mit Keys.Down mache und die Pfeiltaste 'runter' betätige, wirds nur einmal abgesendet wie allgemein gewünscht. Warum ist das so und wie kann ich den Fehler beheben? Public Class Form1 Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short Private Sub Form1_Load(ByVal sender As...
HILFE HILFE HILFE HILFE
04/06/2010 - Metin2 Private Server - 11 Replies
#close



All times are GMT +1. The time now is 03:54.


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.