admin
in editor {script generate update "brain.stimulate"}
mentdb
j23i88m90m76i39t04r09y35p14a96y09e57t36script update "brain.stimulate" 1 "[str],[level]" {
env set var "[fromUser]" (who;);
if (and (type is_int [level];) (>= [level] 0);) {
#Initialize the stimulation;
stimulation initialize [str];
#Get the last simulation;
include "stimulation.last" "[fromUser]" [fromUser];
env set var "[iStim]" 0;
while (and
(< [iStim] [level];)
(not equal (json select element lastStimulation "/_current_action_";) "CLOSED";);) {
#Make a stimulation;
stimulation click;
#Get the last simulation;
include "stimulation.last" "[fromUser]" [fromUser];
env incr var "[iStim]" 1;
};
stimulation get [fromUser] (- (stimulation size [fromUser];) 1);
} {
#Check the stop level;
if (case
(equal [level] "INITIALIZATION";) {true;}
(equal [level] "BASIC_SEARCH";) {true;}
(equal [level] "SEARCH_STRATEGY";) {true;}
(equal [level] "SEARCH_LOGICAL";) {true;}
(equal [level] "CHECK_RELATION";) {true;}
(equal [level] "GET_LAST_RELATION";) {true;}
(equal [level] "EXECUTE_RELATION_RS";) {true;}
(equal [level] "EXECUTE_RELATION_RA";) {true;}
(equal [level] "EXECUTE_RELATION_RL";) {true;}
(equal [level] "REDIRECTION_RELATION";) {true;}
(equal [level] "RELATION_RESPONSE";) {true;}
(equal [level] "RELATION_REDIRECTION";) {true;}
(equal [level] "CLOSED";) {true;}
{false};) {
#The stop level is valid;
#Initialize the stimulation;
stimulation initialize [str];
#Get the last simulation;
include "stimulation.last" "[fromUser]" [fromUser];
while (and
(not equal (json select element lastStimulation "/_current_action_";) [level];)
(not equal (json select element lastStimulation "/_current_action_";) "CLOSED";);) {
#Make a stimulation;
stimulation click;
#Get the last simulation;
include "stimulation.last" "[fromUser]" [fromUser];
};
stimulation get [fromUser] (- (stimulation size [fromUser];) 1);
} {
#The stop level is not valid;
exception (1) ("The stop level is not valid (INITIALIZATION | BASIC_SEARCH | SEARCH_STRATEGY | SEARCH_LOGICAL | CHECK_RELATION | GET_LAST_RELATION | EXECUTE_RELATION_RS | EXECUTE_RELATION_RA | EXECUTE_RELATION_RL | REDIRECTION_RELATION | RELATION_RESPONSE | RELATION_REDIRECTION | CLOSED).");
};
};
};