Apps Home
|
Create an App
m_grizzly_estim
Author:
m_grizzly_1965
Description
Source Code
Launch App
Current Users
Created by:
M_Grizzly_1965
cb.settings_choices = [ {name:'channel_a_min', type:'int', minValue:1, maxValue:99, defaultValue:40, label: "Channel A min"}, {name:'channel_a_value', type:'int', minValue:1, maxValue:99, defaultValue:40, label: "Channel A value"}, {name:'channel_a_step', type:'int', minValue:1, maxValue:99, defaultValue:5, label: "Channel A step"}, {name:'channel_a_max', type:'int', minValue:1, maxValue:99, defaultValue:99, label: "Channel A min"}, {name:'channel_b_min', type:'int', minValue:1, maxValue:99, defaultValue:40, label: "Channel B min"}, {name:'channel_b_value', type:'int', minValue:1, maxValue:99, defaultValue:40, label: "Channel B value"}, {name:'channel_b_step', type:'int', minValue:1, maxValue:99, defaultValue:5, label: "Channel B step"}, {name:'channel_b_max', type:'int', minValue:1, maxValue:99, defaultValue:99, label: "Channel B min"}, {name:'channel_c_min', type:'int', minValue:1, maxValue:99, defaultValue:1, label: "Channel C min"}, {name:'channel_c_value', type:'int', minValue:1, maxValue:99, defaultValue:50, label: "Channel C value"}, {name:'channel_c_step', type:'int', minValue:1, maxValue:99, defaultValue:5, label: "Channel C step"}, {name:'channel_c_max', type:'int', minValue:1, maxValue:99, defaultValue:99, label: "Channel C min"} ]; previous_setting = false; function refresh_all() { cb.drawPanel(); } function get_help_content() { return 'Channel A: type a (or A) to decrease (or increase) by '+cb.settings.channel_a_step+'\n'+ 'Channel A: type A# to step to #. For instance: A69 \n'+ 'Channel B: type b (or B) to decrease (or increase) by '+cb.settings.channel_b_step+'\n'+ 'Channel B: type B# to step to #. For instance: B71 \n'+ 'Channel C: type c (or C) to decrease (or increase) by '+cb.settings.channel_c_step+'\n'+ 'Channel C: type C# to step to #. For instance: C20 \n'+ 'Channel C: low values for pain and torture; high value for (forced) cum'; } function show_help(user) { cb.sendNotice(get_help_content(), user); } function set_a(value) { if (value < cb.settings.channel_a_min) { value = cb.settings.channel_a_min; } else if (value > cb.settings.channel_a_max) { value = cb.settings.channel_a_max; } if (value != cb.settings.channel_a_value) { cb.settings.channel_a_value = value; return true; } return false; } function inc_a(step) { return set_a(cb.settings.channel_a_value + step); } function set_b(value) { if (value < cb.settings.channel_b_min) { value = cb.settings.channel_b_min; } else if (value > cb.settings.channel_b_max) { value = cb.settings.channel_b_max; } if (value != cb.settings.channel_b_value) { cb.settings.channel_b_value = value; return true; } return false; } function inc_b(step) { return set_b(cb.settings.channel_b_value + step); } function set_c(value) { if (value < cb.settings.channel_c_min) { value = cb.settings.channel_c_min; } else if (value > cb.settings.channel_c_max) { value = cb.settings.channel_c_max; } if (value != cb.settings.channel_c_value) { cb.settings.channel_c_value = value; return true; } return false; } function inc_c(step) { return set_c(cb.settings.channel_c_value + step); } function each_minute() { refresh = false; if (previous_setting === false) { previous_setting = Object.assign({}, cb.settings); } else { if (cb.settings.channel_a_value == previous_setting.channel_a_value) { if (inc_a(-cb.settings.channel_a_step)) { refresh = true; } } if (cb.settings.channel_b_value == previous_setting.channel_b_value) { if (inc_b(-cb.settings.channel_b_step)) { refresh = true; } } previous_setting = Object.assign({}, cb.settings); } if (refresh) { refresh_all(); } cb.setTimeout(each_minute, 60000) } // cb.setTimeout(each_minute, 60000) cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': 'Ch. A cock (type a or A):', 'row1_value': cb.settings.channel_a_value, 'row2_label': 'Ch. B ball (type b or B):', 'row2_value': cb.settings.channel_b_value, 'row3_label': 'Ch. C freq (type help):', 'row3_value': cb.settings.channel_c_value }; }); cb.onEnter(function(user) { cb.sendNotice('Welcome ' + user['user'] + '!\n'+ 'You can control my estim power unit!\n'+ 'Type help, if you want to know more.', user['user']); }); cb.onMessage(function (message) { refresh = false; msg = message.m.toLowerCase(); first_char = msg.substring(0,1); trailing_part = msg.substring(1); is_number = /^\d+$/.test(trailing_part); if (msg == "help") { show_help(message.user); } else if (msg == "test") { cb.sendNotice('TEST ME'); } else if (message.m == "a") { if (inc_a(-cb.settings.channel_a_step)) { refresh = true; } message.m = "a" + cb.settings.channel_a_value } else if (message.m == "A") { if (inc_a(cb.settings.channel_a_step)) { refresh = true; } message.m = "A" + cb.settings.channel_a_value } else if (first_char == "a" && trailing_part.length > 0 && is_number) { if (set_a(parseInt(trailing_part))) { refresh = true; } message.m = "A" + cb.settings.channel_a_value } else if (message.m == "b") { if (inc_b(-cb.settings.channel_b_step)) { refresh = true; } message.m = "b" + cb.settings.channel_b_value } else if (message.m == "B") { if (inc_b(cb.settings.channel_b_step)) { refresh = true; } message.m = "B" + cb.settings.channel_b_value } else if (first_char == "b" && trailing_part.length > 0 && is_number) { if (set_b(parseInt(trailing_part))) { refresh = true; } message.m = "B" + cb.settings.channel_b_value } else if (message.m == "c") { if (inc_c(-cb.settings.channel_c_step)) { refresh = true; } message.m = "c" + cb.settings.channel_c_value } else if (message.m == "C") { if (inc_c(cb.settings.channel_c_step)) { refresh = true; } message.m = "C" + cb.settings.channel_c_value } else if (first_char == "c" && trailing_part.length > 0 && is_number) { if (set_c(parseInt(trailing_part))) { refresh = true; } message.m = "C" + cb.settings.channel_c_value } if (refresh) { refresh_all(); } return message; });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.