Post: Visual Number Editor?
01-30-2016, 05:56 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); Does someone have a script for visually crafting numbers for use with functions? I want to be able to increase/decrease each digit in a number using in-game controls instead of hard-coding certain amounts. This comes in hands for stats functions especially. I have seen this being used in Call of Duty 4: Modern Warfare and the script is as follows:
    #include common_scripts\utility;
#include maps\custom\_utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

openStatEditor( action )
{
self notify( "endSelection" );
self notify( "statEditorOpened" );

self._inStatEditor = 1;
self._string = "";
self._numberOfCharacters = 0;
self._characterPosition = 0;
self._characterSet = "numbers";

self disableHUD();
self enableBlur();

self showStatEditor();

self thread initCharacters();
self thread closeStatEditor( action );
self thread showInstructions();
self thread showText();

wait 0.20;

self thread monitorAttackButton();
self thread monitorAdsButton();
self thread monitorUseButton();
self thread monitorMeleeButton();
self thread monitorReloadButton();
self thread monitorSecondaryOffhandButton();

self disableControls();
}

closeStatEditor( action )
{
self waittill_any_return( "endStatEditor", "death", "game_ended" );

self notify( "statEditorClosed" );

self enableHUD();
self disableBlur();

self enableControls();

self thread hideStatEditor();

self thread hideInstructions();

newValue = int( self._string );

self maps\mp\gametypes\_persistence::statSet( action, newValue );

self._inStatEditor = 0;
}

showInstructions()
{
self.directions = newClientHudElem( self );
self.directions.fontScale = 1.20;
self.directions defineElement( ( 1, 1, 1 ), true, "center", "bottom", 0, 0, 1, 1 );

options = "[{+attack}] Increase Number,[{+speed_throw}] Decrease Number,[{+melee}] Confirm,[{+reload}] Backspace,[{+activate}] Next Number";
options = strTok( options, "," );

directions = options[0] + " | " + options[1] + " | " + options[2] + " | " + options[3] + " | " + options[4];

self.directions setText( directions );
}

hideInstructions()
{
self.directions destroy();
}

initCharacters()
{
switch( self._characterSet )
{
case "numbers":
characters = "0,1,2,3,4,5,6,7,8,9";
self._characters = strTok( characters, "," );
break;
default:
break;
}
}

showStatEditor()
{
self.textArea.alpha = 1;

wait 0.02;

self.menuShader[0].alpha = 0.75;
}

hideStatEditor()
{
self.textArea.alpha = 0;

wait 0.02;

self.menuShader[0].alpha = 0;
}

monitorAttackButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill_any_return( "attackButtonPressed", "attackButtonHeld" );

self._characterPosition++;

if( self._characterPosition >= self._characters.size ) self._characterPosition = 0;
}
}

monitorUseButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "useButtonPressed" );

self._history[self._numberOfCharacters] = self._string;
self._string = self._string + self._characters[self._characterPosition];
self._numberOfCharacters++;
}
}

monitorReloadButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "reloadButtonPressed" );

lastNumber = self._numberOfCharacters - 1;

if( lastNumber <= 0 ) lastNumber = 0;

self._string = self._history[lastNumber];
self._numberOfCharacters = lastNumber;
}
}

monitorAdsButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill_any_return( "adsButtonPressed", "adsButtonHeld" );

self._characterPosition--;

if( self._characterPosition < 0 ) self._characterPosition = self._characters.size - 1;
}
}

monitorSecondaryOffhandButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "secondaryOffhandButtonPressed" );
}
}

monitorMeleeButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "meleeButtonPressed" );

self notify( "endStatEditor" );
}
}

showText()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
cursor = "^2" + self._characters[self._characterPosition];

wait 0.05;

self.textArea setText( self._string + cursor );
}
}

    self.subDirOption[5][0] defineOption( "Prestige Level", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "plevel" );
self.subDirOption[5][1] defineOption( "Total Time Played", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "time_played_total" );
self.subDirOption[5][2] defineOption( "Kills", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "kills" );
self.subDirOption[5][3] defineOption( "Deaths", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "deaths" );
self.subDirOption[5][4] defineOption( "Headshots", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "headshots" );
self.subDirOption[5][5] defineOption( "Hits", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "hits" );
self.subDirOption[5][6] defineOption( "Misses", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "misses" );
self.subDirOption[5][7] defineOption( "Wins", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "wins" );
self.subDirOption[5][8] defineOption( "Losses", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "losses" );


This is for you guys to see what I mean since I didn't see anyone have this in Black Ops 2.
(adsbygoogle = window.adsbygoogle || []).push({});
01-30-2016, 06:39 PM #2
HiddenHour
I defeated!
Originally posted by BullyWiiPlaza View Post
Does someone have a script for visually crafting numbers for use with functions? I want to be able to increase/decrease each digit in a number using in-game controls instead of hard-coding certain amounts. This comes in hands for stats functions especially. I have seen this being used in Call of Duty 4: Modern Warfare and the script is as follows:
    #include common_scripts\utility;
#include maps\custom\_utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

openStatEditor( action )
{
self notify( "endSelection" );
self notify( "statEditorOpened" );

self._inStatEditor = 1;
self._string = "";
self._numberOfCharacters = 0;
self._characterPosition = 0;
self._characterSet = "numbers";

self disableHUD();
self enableBlur();

self showStatEditor();

self thread initCharacters();
self thread closeStatEditor( action );
self thread showInstructions();
self thread showText();

wait 0.20;

self thread monitorAttackButton();
self thread monitorAdsButton();
self thread monitorUseButton();
self thread monitorMeleeButton();
self thread monitorReloadButton();
self thread monitorSecondaryOffhandButton();

self disableControls();
}

closeStatEditor( action )
{
self waittill_any_return( "endStatEditor", "death", "game_ended" );

self notify( "statEditorClosed" );

self enableHUD();
self disableBlur();

self enableControls();

self thread hideStatEditor();

self thread hideInstructions();

newValue = int( self._string );

self maps\mp\gametypes\_persistence::statSet( action, newValue );

self._inStatEditor = 0;
}

showInstructions()
{
self.directions = newClientHudElem( self );
self.directions.fontScale = 1.20;
self.directions defineElement( ( 1, 1, 1 ), true, "center", "bottom", 0, 0, 1, 1 );

options = "[{+attack}] Increase Number,[{+speed_throw}] Decrease Number,[{+melee}] Confirm,[{+reload}] Backspace,[{+activate}] Next Number";
options = strTok( options, "," );

directions = options[0] + " | " + options[1] + " | " + options[2] + " | " + options[3] + " | " + options[4];

self.directions setText( directions );
}

hideInstructions()
{
self.directions destroy();
}

initCharacters()
{
switch( self._characterSet )
{
case "numbers":
characters = "0,1,2,3,4,5,6,7,8,9";
self._characters = strTok( characters, "," );
break;
default:
break;
}
}

showStatEditor()
{
self.textArea.alpha = 1;

wait 0.02;

self.menuShader[0].alpha = 0.75;
}

hideStatEditor()
{
self.textArea.alpha = 0;

wait 0.02;

self.menuShader[0].alpha = 0;
}

monitorAttackButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill_any_return( "attackButtonPressed", "attackButtonHeld" );

self._characterPosition++;

if( self._characterPosition >= self._characters.size ) self._characterPosition = 0;
}
}

monitorUseButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "useButtonPressed" );

self._history[self._numberOfCharacters] = self._string;
self._string = self._string + self._characters[self._characterPosition];
self._numberOfCharacters++;
}
}

monitorReloadButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "reloadButtonPressed" );

lastNumber = self._numberOfCharacters - 1;

if( lastNumber <= 0 ) lastNumber = 0;

self._string = self._history[lastNumber];
self._numberOfCharacters = lastNumber;
}
}

monitorAdsButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill_any_return( "adsButtonPressed", "adsButtonHeld" );

self._characterPosition--;

if( self._characterPosition < 0 ) self._characterPosition = self._characters.size - 1;
}
}

monitorSecondaryOffhandButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "secondaryOffhandButtonPressed" );
}
}

monitorMeleeButton()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
self waittill( "meleeButtonPressed" );

self notify( "endStatEditor" );
}
}

showText()
{
self endon( "statEditorClosed" );

for(;Winky Winky
{
cursor = "^2" + self._characters[self._characterPosition];

wait 0.05;

self.textArea setText( self._string + cursor );
}
}

    self.subDirOption[5][0] defineOption( "Prestige Level", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "plevel" );
self.subDirOption[5][1] defineOption( "Total Time Played", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "time_played_total" );
self.subDirOption[5][2] defineOption( "Kills", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "kills" );
self.subDirOption[5][3] defineOption( "Deaths", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "deaths" );
self.subDirOption[5][4] defineOption( "Headshots", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "headshots" );
self.subDirOption[5][5] defineOption( "Hits", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "hits" );
self.subDirOption[5][6] defineOption( "Misses", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "misses" );
self.subDirOption[5][7] defineOption( "Wins", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "wins" );
self.subDirOption[5][8] defineOption( "Losses", "function", 2, maps\custom\_stat_editor:GasppenStatEditor, "losses" );


This is for you guys to see what I mean since I didn't see anyone have this in Black Ops 2.



  1. Set up button monitoring
  2. Give a variable a number(I'll make mine self.adjustableNum = 0)
  3. To change variable numbers, use += or -= the increment you want using whatever buttons you want(self.adjustableNum += 1)
  4. When you have your desired number, use the variable in your function (self iprintln(self.adjustableNum))


Heres an example
    buttonMonitor()
{
self notify("end_buttonMonitor");

self endon("disconnect");
self endon("game_ended");
self endon("end_buttonMonitor");

self.num = 0;

for(;Winky Winky
{
if(self actionSlotOneButtonPressed())//UP
{
self.num += 1;
//print self.num
}
if(self actionSlotTwoButtonPressed())//DOWN
{
self.num -= 1;
//print self.num
}
if(self meleeButtonPressed())//CLOSE
{
//setStat(statArgument, self.num);

self iprintln("Stat set");

//If you want to use this function for any stat, make an argument in the function for it.

self notify("end_buttonMonitor");
}
wait 0.01;
}
}

The following user thanked HiddenHour for this useful post:

BullyWiiPlaza

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo