Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Change variable in plugin from quest profile

Featured Replies

@Asoter Hello, in order to make a variable changeable by quester, you can transform your current variable into an property.

Let's say you have an quest counter in your plugin defined as int:

public int QuestCounter = 0;

So you need to change this into this:

    public int QuestCounter
    {
        get
        {
            return robotManager.Helpful.Var.GetVar<int>(this.GetType().GetProperties().FirstOrDefault()?.Name);
        }
        set
        {
            robotManager.Helpful.Var.SetVar(this.GetType().GetProperties().FirstOrDefault()?.Name, value);
        }
    }

You can still treat as an normal variable.

 

And in Quester it looks like this:

counter.JPG.524a94f1c044d6b265803c6e02f8bd58.JPG

robotManager.Helpful.Var.SetVar("QuestCounter", 12);

 

Edited by reapler
mistaken CVar <-> Var

  • Author

got error when definie this :(

    public int QuestCounter
    {
        get
        {
            return robotManager.Helpful.Var.GetVar<int>(this.GetType().GetProperties().FirstOrDefault()?.Name);
        }
        set
        {
            robotManager.Helpful.Var.SetVar(this.GetType().GetProperties().FirstOrDefault()?.Name, value);
        }
    }
  • Author

Hey Again, anyway, got another problem, got no errors but variable finaly didnt change, Im trying to debuging this...:

 

20:34:55 - readyIntoDungeon False
20:34:57 - [PartyChatCommand] Run [CSharp] go to dungeon > robotManager.Helpful.Var.SetVar("readyIntoDungeon", true);
20:34:59 - readyIntoDungeon False
20:35:03 - readyIntoDungeon False
20:35:07 - readyIntoDungeon False

and secondly i define this without question mark after First or Default(beacause with mark I got error from WRobot):
 

    public bool readyIntoDungeon
    {
        get
        {
            return Var.GetVar<bool>(this.GetType().GetProperties().FirstOrDefault().Name);
        }
        set
        {
            Var.SetVar(this.GetType().GetProperties().FirstOrDefault().Name, value);
        }
    }

btw trying with profile but didnt work

@Asoter Everything looks fine, checked names and values. For me it works: doesn't matter in "RunCode" or in plugin.

You may try this snippet:

using System;
using System.Linq;
using robotManager.Helpful;
using wManager.Plugin;


public class Main : IPlugin
{
        public bool readyIntoDungeon
        {
            get
            {
                Logging.Write(this.GetType().GetProperties().FirstOrDefault().Name);
                return Var.GetVar<bool>(this.GetType().GetProperties().FirstOrDefault().Name);
            }
            set
            {
                Logging.Write(this.GetType().GetProperties().FirstOrDefault().Name);
                Var.SetVar(this.GetType().GetProperties().FirstOrDefault().Name, value);
            }
        }
    
    public void Initialize()
    {
        Logging.Write(""+readyIntoDungeon);
    }

    public void Dispose()
    {

    }
    
    public void Settings()
    {
        readyIntoDungeon = true;
    }
}

Click on settings button then start bot. If it's not printing "true", then something else could be wrong with your plugin. But without an insight into your code, i can't really define the problem.

  • Author

Yeah, thanks for explain, with this plugin you show that work(problem is inside my plugin...).  Thanks again! :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.