Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.gamebuster19901.GameBuSK.effects;
- import org.bukkit.event.Event;
- import com.google.common.collect.Iterables;
- import ch.njol.skript.lang.Effect;
- import ch.njol.skript.lang.Expression;
- import ch.njol.skript.lang.SkriptParser.ParseResult;
- import ch.njol.util.Kleenean;
- public class EffGoToURL extends Effect {
- private Expression<GWebDriver> browser;
- private Expression<String> URL;
- @SuppressWarnings("unchecked")
- @Override
- public boolean init(Expression<?>[] expr, int matchedPattern, Kleenean paramKleenean,
- ParseResult paramParseResult) {
- // TODO Auto-generated method stub
- browser = (Expression<GWebDriver>) expr[0];
- URL = (Expression<String>) expr[1];
- return true;
- }
- @Override
- public String toString(Event paramEvent, boolean paramBoolean) {
- // TODO Auto-generated method stub
- return "close window";
- }
- @Override
- protected void execute(Event paramEvent) {
- // TODO Auto-generated method stub
- GWebDriver locBrowser = browser.getSingle(paramEvent); //This does not work, getSingle attempts to cast my GWebBrowser as a string, and that is currently not possible
- String locUrl = URL.getSingle(paramEvent);
- locBrowser.goTo(locUrl);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement