User Tools

Site Tools


script_fast_run

====== About the script ====== * Purpose : This script will let you write/paste a script and run it directly from a custom eval javascript feature. * Version: [Moved to Play Store] * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/dovekq6MuBE [[https://plus.google.com/u/1/105066926163073195690/posts/geeR8FxuKd5|First version]] ====== APK ====== This script is now on Play Store! Go here to download it! https://play.google.com/store/apps/details?id=com.trianguloy.llscript.fastRunTool <spoiler | Old code> ====== How to use the script ====== This script is a little tool for those who want to launch short (or long) scripts in an easy way, without need to write a new one, launch it, forget to delete it... Features: * - Automatically save the last executed script * - Custom predefined vars: e-event, c-container, i-item (of the event) [if they are not available it will say so] * - Custom functions: * - void Toast(string) [will show a toast with the string] * - NEW: string iTag(string) [use this to set fast and easily tags to the item and the container and/or to retrieve the tags. If you want to remove it call them with 'null' as string. Example iTag('null') will remove the tag of the item and iTag() will just return the tag] * - NEW: string cTag(string) [the same as iTag() but with the container's tag] * - NEW: The value returned of the last line will automatically be shown except if there is a ';'. Use this to quickly output values. NEW IN VERSION 2: you can now use alert/prompt/whatever you want! ====== Script code ====== <sxh javascript> /*Available vars */ var e = LL.getEvent(); var c = e.getContainer(); var i = e.getItem(); var text = LL.getScriptTag() || ""; var out = prompt("Functions: Toast(string) "+ (c!=null ? ",String cTag(String) ":"")+ (i!=null ? ",String iTag(String) ":"")+ "\nVars: e-event,"+ (c!=null? "c-container,":"[no container],")+ (i!=null? "i-item":"[no item]")+ "\n\nPrevious input: \n"+ text+ "\n_____________________________________",text); //Change this 'line' if you want if(out!=null) { LL.setScriptTag(out); var last=out.lastIndexOf("\n")+1; function returningTheSame(a){return a;}; if(out.substr(last).search(';')==-1) out=out.substr(0,last)+"prompt('»"+out.substr(last)+"«',returningTheSame( "+out.substr(last)+"));"; out="function fastRunTool(){"+out+"}"; eval(out); fastRunTool(); } /*available functions */ function Toast(say){ if(say==null)say="null"; Android.makeNewToast(say,false).show(); } function iTag(setnew){ if(setnew!=undefined){ if(setnew=='null')setnew=null; i.setTag(setnew); } return i.getTag(); } function cTag(setnew){ if(setnew!=undefined){ if(setnew=='null')setnew=null; c.setTag(setnew); } return c.getTag(); } </sxh> </spoiler>

script_fast_run.txt · Last modified: 2015/12/11 16:52 by trianguloy