Skip to content

Instantly share code, notes, and snippets.

@jonatino
jonatino / main.rs
Last active September 18, 2024 17:02
Update with /u/WorldsBegin solution
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::collections::{HashMap, VecDeque};
use std::ops::{Coroutine, CoroutineState};
use std::pin::Pin;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
type PlayerScript = Pin<Box<dyn Coroutine<&'static mut Player, Yield = f32, Return = ()>>>;
pub struct PlayerTask {
// extern crate bindgen;
// use std::env;
// use std::path::PathBuf;
fn main() {
// Tell cargo to tell rustc to link the Gdiplus shared library.
println!("cargo:rustc-link-lib=Gdiplus");
// // Tell cargo to invalidate the built crate whenever the wrapper changes
use crate::player::Player;
#[derive(PartialEq, Eq, Hash)]
pub enum InterfaceLocation {
None,
Main = 1
}
#[derive(PartialEq, Eq, Hash)]
extern crate config;
#[macro_use]
extern crate serde_derive;
use std::{convert::Infallible, net::SocketAddr};
use std::sync::Mutex;
use hyper::{Body, Request, Response, Server, StatusCode};
use hyper::service::{make_service_fn, service_fn};
use rand::prelude::SliceRandom;
package net.runelite.cache
import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled
import net.runelite.cache.fs.Container
import net.runelite.cache.fs.Store
import net.runelite.cache.fs.flat.FlatStorage
import net.runelite.cache.fs.jagex.DataFileWriteResult
import net.runelite.cache.fs.jagex.DiskStorage
import net.runelite.cache.fs.jagex.IndexEntry
@jonatino
jonatino / binfs.hpp
Created November 27, 2020 07:16
Binfs.hpp
This file has been truncated, but you can view the full file.
#ifndef _BINFS_OUTPUT_HPP_
#define _BINFS_OUTPUT_HPP_
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
@jonatino
jonatino / win.go
Created October 25, 2020 04:38
Ultralight Workaround for Favicons - Windows 10
// +build windows
package main
import (
"os"
"syscall"
"unsafe"
)
package main
import (
"fmt"
"syscall"
"unsafe"
)
var (
user32, _ = syscall.LoadLibrary("User32.dll")
package server.model.players;
import java.util.concurrent.CopyOnWriteArrayList;
import server.Config;
import server.Server;
import server.event.CycleEvent;
import server.event.CycleEventContainer;
import server.event.CycleEventHandler;
import server.model.items.GameItem;
public static void openDialogue(final Player player, int dialogueId) {
try {
System.out.println("Starting: "+dialogueId);
if (player == null)
return;
if (dialogueId == -1) {
return;
}
for (int i = 0; i < 5; i++) {
player.getInterfaceState().setNextDialogueId(i, -1);