Skip to content

Instantly share code, notes, and snippets.

View chsami's full-sized avatar

chsami chsami

View GitHub Profile
public static Tile getTile(WorldPoint point) {
LocalPoint a = LocalPoint.fromWorld(Microbot.getClient(), point);
if (a == null) {
return null;
}
return Microbot.getClient().getScene().getTiles()[point.getPlane()][a.getSceneX()][a.getSceneY()];
}
public static boolean isDoorPresent(WorldPoint a, WorldPoint b) {
WallObject wallObject = getTile(a).getWallObject();
@chsami
chsami / ExamplePlugin
Created May 20, 2023 21:31
Example Plugin Runelite
package net.runelite.client.plugins.example;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.events.GameStateChanged;
import net.runelite.client.Mouse;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
@chsami
chsami / Mouse.java
Created May 20, 2023 21:21
VirtualMouse java
package net.runelite.client;
import lombok.Setter;
import net.runelite.api.Client;
import java.awt.*;
import java.awt.event.MouseEvent;
public class Mouse {
{
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc",
"balance": 30,
"accounts": ["/account/12345",
"/account/67890"]
}
{
"message": "Customer not found.",
"documentation":"https://example.com/docs/readme
}
{
"success": false,
"error": {
"code": 422,
"type": "customer_duplicate",
"detail": "Customer already exists"
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using WebAPI.Models;
using WebAPI.Models.Database3PWEB;
using WebAPI.Models.ViewModels;
namespace WebAPI.Services
@chsami
chsami / tolist.cs
Last active October 12, 2021 17:45
List<Entity> list = dbContext.Entity.Where(x => x.Foo == "Foo").ToList()
foreach(var item in list) {
Console.WriteLine(item.ToString())
}
@chsami
chsami / IQueryableForEach.cs
Last active October 12, 2021 17:45
IQueryable inside foreach
IQueryable<Entity> query = dbContext.Entity.Where(x => x.Foo == "Foo")
foreach(var item in query) {
Console.WriteLine(item.ToString())
}
@chsami
chsami / MyService.cs
Last active September 16, 2021 16:20
public class MyService
{
private static Dictionary<string, string> dictionary;
public async Task loadData()
{
dictionary = new Dictionary<string, string>()
{
{"test", "test" }
};