How to run a script?

Next
 From:  Mike_A
6336.1 
Total newby question - I can't find anything in the documentation etc.

How do I run a script in MoI?
It looks like I have to create a shortcut and edit the .ini file?
Or are there other ways?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  milkywaif
6336.2 In reply to 6336.1 
there are couple of ways. easiest way is pasting your script into the mini command line.
1. Hit tab key to focus mini command line,
2. ctrl+v to paste your copied script.
3. Hit enter to execute your script.

also you can go to "options/shortcut keys/add" to add a new hotkey then paste your scipt into "Command" section and write down any key combination you'd like in "Key" section.

also you can save your script as a .js file and run it using scipt's name.
for example; your script is called MyScript.js and its placed in /commands folder. You simply type MyScript in "mini command line" and it's executed.
- Evren
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6336.3 In reply to 6336.1 
Hi Mike, it also kind of depends a bit on what particular kind of script you want to run.

There are 2 basic types of scripts - plug-in commands, and "inline scripts".

A plug-in has files that have to be copied into the \commands sub-folder. That then makes a new command available and you can set up a shortcut key with that command name as the thing to execute.

For an inline script generally those are smaller snippets of script code for doing stuff like hiding or selecting things, basically things that trigger instantly and don't have any UI controls. Those you paste directly into the command part of the shortcut key editor.

You don't need to edit moi.ini directly for shortcut keys, at one point very early on in MoI that's how you had to set up shortcut keys but you can just go to Options > Shortcut keys for it now.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6336.4 
There are a lot of Keys that can be used for shortcuts.
Some of them:
0 or 1 or2 or ... 9
A or B or C or ... Z
Most of F1, ... F12
Alt+___ ,(one of the above)
Ctrl+___
Shift+___
Ctrl+Alt+___
Ctrl+Shift+___
DownArrow,UpArrow...PageDown...,Delete

I have not tried every combination...

Keys not allowed: ??????
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6336.5 In reply to 6336.4 
Hi Brian,

> Keys not allowed: ??????

Just Tab and Escape I guess, those already do different things.

Although you can put in number keys like 1, 2, 3, 4, etc... as shortcut keys if you do that it will interfere with typing that same number to do the quick auto focus behavior for filling in numeric input fields.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Mike_A
6336.6 
Gents,
Just a note to say thank you - lots of very useful info here for a MoI newby like myself.

Mike
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All