ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

[HELP REQUEST] How does one add the literal integer values of two variables in loliscript?


  • Please log in to reply
[HELP REQUEST] How does one add the literal integer values of two variables in loliscript?

#1

LiamHemsworth
LiamHemsworth
    Offline
    2
    Rep
    25
    Likes

    Veteran

Posts: 492
Threads: 27
Joined: Apr 07, 2019
Credits: 0
Five years registered
#1

Okay, so to explain the situation I have two variables, "a" and "b". Each one of these contains an integer, set up as follows:

PARSE "<SOURCE>" LR "\"points\":" "," -> VAR "a"
PARSE "<SOURCE>" LR "\"pendingpoints\":" "," -> VAR "b"

I want to simply add the values of the variables "a" and "b" together, to produce variable "c" to be sent to capture. I can't seem to simply do it, as it doesn't work no matter what I've tried. I'm quite lost, as it seems to be viewing them as strings, though I'm unsure how to define them as integers as I'm still very new to loliscript.

 

Any help is massively appreciated.


  • 0

#2

CaptainModz
CaptainModz
    Offline
    18
    Rep
    127
    Likes

    OpenBullet Config Dev

Posts: 198
Threads: 52
Joined: Aug 10, 2019
Credits: 0

Four years registered
#2

I would also like to know, because alot of my configs capture multiple giftcard codes, and the value on those codes. Be nice if I knew how to add the two numbers to see the total price of giftcards on each account.


  • 1

#3

LiamHemsworth
LiamHemsworth
    Offline
    2
    Rep
    25
    Likes

    Veteran

Posts: 492
Threads: 27
Joined: Apr 07, 2019
Credits: 0
Five years registered
#3

I would also like to know, because alot of my configs capture multiple giftcard codes, and the value on those codes. Be nice if I knew how to add the two numbers to see the total price of giftcards on each account.

This. Literally almost the exact same situation for me, where I just want to add the values of pending points and points to be one combined value. It's so weird how it can't just be done simply.


  • 0

#4

noobsnipes
noobsnipes
    Offline
    5
    Rep
    53
    Likes

    Junkie

  • PipPipPipPipPipPip
Posts: 304
Threads: 28
Joined: Jul 04, 2018
Credits: 0

Deal with caution
User has an open scam report.
Five years registered
#4

try compute function and input being <a>+<b>. This wont work for a recursive variable, but should work for your needs


  • 0

#5

Wafend
Wafend
    Offline
    190
    Rep
    852
    Likes

    Config Maker

Posts: 1633
Threads: 368
Joined: Nov 12, 2017
Credits: 0

Six years registered
#5

yes like noobsnipes said

function block --> compute --> <a>+<b>. Also tick capture


  • 0

?url=https%3A%2F%2Fwww.wiproud.com%2Fwp-



 Users browsing this thread: