« first day (31 days earlier)      last day (624 days later) » 

3:16 PM
Evaluating script: "I'm here!".replaceAll("\S([a-z])", "$1$1$1")
I'll add some kind of error message for exceptions later
 
They explain it here but it's a bit confusing: javacodegeeks.com/2012/06/…
I am thinking if it would be alright if I just did a null check first
 
!!eval:return x
 
!!eval:function give(par){return par;} give(1)
I'm going to set up a hastebin so that when we deploy the bot, whenever he crashes I'd get an email to visit his crashlog.
Sounds like a plan?
 
Sure
 
Him still alive?
@KalaJ It's hard to find out what you're doing wrong with the vague problem description.
 
3:24 PM
@Unihedron it's groovy.
 
@Justin Yeah.
 
!!:eval give(par){return par} give(1)
 
......
!!eval:give(par){return par} give(1)
 
you broke him :(
 
Hello @JavaBot
:(
Reboot pls :)
 
3:25 PM
!!eval:"I'm here!"
 
I'm here!
 
!!eval:give(par){return par} give(1)
 
If you check out that link, I'm pretty much doing exactly that lol
 
!!eval:"Rawr"
 
Rawr
 
3:26 PM
I think you need a return type
 
Oh.
!!eval:<T>T give(T par){return par} give(1)
 
I fixed it based on that link but I'm still confused how it prevents a null pointer. So I want to understand this link: javacodegeeks.com/2012/06/…
 
!!eval: int give(par){return par} give(1)
 
First example on that link
 
!!eval:give(par){return par} give(Integer.valueOf(1))
 
3:27 PM
Hmm
 
!!eval:<T>T give(T par){return par} give(Integer.valueOf(1))
 
Lol
 
!!eval:<T>T give(T par){return par;} give(Integer.valueOf(1))
 
!!eval:System.out.println("Test")
 
!!eval:"hi"
 
3:27 PM
hi
 
I think it has something to do with the way I'm evaluating scripts
I'm using the groovy console
It's also inside a base class
!!eval: run(){"Test"}; run()
 
Maybe we could check if the script requires a method scope, type scope or file scope before running the script.
 
!!eval:run(){"Test"};run();
 
!!eval: String run(){"Test"}; run()
 
!!eval def run(){"Test"};run();
 
3:31 PM
!!eval:"a".replaceFirst("a", "bc")
 
b
 
!!eval: def run(){"Test"};run()
 
!!eval: x = "Test"
 
Test
 
!!eval: println x
Interesting.
 
3:32 PM
pulling 27 commits..
 
Lol
!!eval:x
 
Test
 
There we go
 
!!eval: System.out.println(x);
 
!!eval:def doSomething() { return "Test" };
!!eval:doSomething()
 
3:34 PM
If we want to run Java we have to use JavaCompiler?
 
No 0_o
 
How does this work?
 
You can write groovy scripts in java.
!!eval:def doSomething() { return "Test" }; doSomething();
 
Test
 
Works like that ^
Apparently groovy methods still need a return statement.
 
3:35 PM
That's... Like a mix of JavaScript and Python :P
 
Lol!
!!eval:doSomething() { return "Stuff" }; doSomething();
must def!
!!eval:def doSomething() { return "Stuff" }; doSomething();
 
Stuff
 
!!eval: cookies = true;
 
true
 
!!eval:if(cookies) return "Yum"
 
3:37 PM
Yum
 
So, you have that. You can define global variables.
!!eval: def notLikeThis = true;
 
true
 
!!eval:def check() { return "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person" };
!!eval:check()
 
!!eval if(!notLikeThis) return "Absolutely not";
Need to add error messages
 
!!eval:check();
!!eval:def check() { return "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person" }
!!eval:check()
 
3:39 PM
As it is, you can't define global functions like that
unless you umm.. use a lambda
 
!!eval:def check() { return "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person" }; check()
!!eval:def check() { return "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person" }; check();
 
!eval: x = { return "Bro I'm a lambda" };
!eval:x
 
ha
 
Pfft. Lol
!!eval "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person"
oops
!!eval:"Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person"
!!eval:return { "Justin is a " + Math.random() * 6 == 0 ? "terrible" : "nice") + "person" }
Strange stuff.
 
Don't tell me java.lang doesn't work in groovy.
 
3:44 PM
!!eval: import java.lang.*
 
!!eval: "Hello" + ' ' + "World!"
 
!!eval: return { "Hello" + ' ' + "World!" }
 
EvalCommand$_run_closure1@388a6f09
 
:o
!!eval:return
!!eval: x { "Test" }
!!eval:def check() { return "Justin is a " + ((int)(Math.random() * 6) == 0 ? "terrible" : "nice") + "person" } return check();
He's still just a baby. He'll learn.
!!eval:Math.random()
 
0.271541920131651
 
3:51 PM
!!eval:System.exit(0)
 
!!eval:"hi"
aww, he's dead
 
!!eval:System.exit(0)
!!eval:System.exit(0)
 
You can't shut me down!
 
Yay
 
4:03 PM
Lol
!!eval:binding.variables
!!eval:binding.variables.toString()
 
[javaBot:com.gmail.inverseconduit.JavaBot@5a8f28c1]
 
0_o
He missed a message there
!!eval:binding.variables
 
{javaBot=com.gmail.inverseconduit.JavaBot@5a8f28c1}
 
!!eval:new Thread()
 
Thread[Thread-2,5,main]
 
4:09 PM
Yea, don't do that.
 
... Maybe we should prevent threads from being created.
 
4:37 PM
Lol
!!eval:System.exit(0)
!!eval:"."
 
!!eval:"hi"
 
.
hi
 
!!eval:"test"
!!eval:"test"
 
test
 
!!eval:"hello world"
 
4:44 PM
hello world
 
!!eval:"Hello" + " " + "World"
 
Hello World
 
!!help
 
Lol
!!eval: def x = "Hello World!".split(" "); return(x[1] + x[0])
 
World!Hello
 
4:51 PM
Cool, we have a bot that runs a groovy script. Well done guys :)
 
!!eval:Collections.shuffle("Hello World!".split(""))
 
No signature of method: static java.util.Collections.shuffle() is applicable for argument types: ([Ljava.lang.String;) values: [[H, e, l, l, o, , W, o, r, l, d, !]]
Possible solutions: shuffle(java.util.List), shuffle(java.util.List, java.util.Random)
 
Well then.
 
o_O
 
Thank you very much.
 
4:53 PM
Implement more features! :D
 
!!eval:Collections.shuffle(("Hello World!".split("")))
 
No signature of method: static java.util.Collections.shuffle() is applicable for argument types: ([Ljava.lang.String;) values: [[H, e, l, l, o, , W, o, r, l, d, !]]
Possible solutions: shuffle(java.util.List), shuffle(java.util.List, java.util.Random)
 
Oh, I thought that might work.
 
Use Arrays.asList()
!!eval:Collections.shuffle(Arrays.asList("Hello World!".split("")))
 
Should sooo not be needed on groovy.
 
4:54 PM
fu-
@Justin Meh, we should switch to JavaCompiler.
 
Why 0_o
!!eval:return Collections.shuffle("Hello World!".split("").toList())
 
-_-
 
Why would you want to switch?
 
Groovy is too mainstream.
Nah, just joking. :P
 
There are some things that need sorted out but I don't see anything actually wrong with Groovy. Plus it makes most things a lot easier.
!!eval:Collections.shuffle("Hello World!".split("").toList())
 
5:01 PM
Nope. GG
 
Just need more feedback for what's wrong. It's probably some silly compiling error.
!!eval:"Hello World!".toList())
 
startup failed:
EvalCommand: 1: expecting EOF, found ')' @ line 1, column 24.
"Hello World!".toList())
^

1 error
 
That's better.
 
:D
!!eval:(
 
startup failed:
EvalCommand: 1: unexpected token: @ line 1, column 2.
(
^

1 error
 
5:04 PM
!!eval:"Hello World!".toList()
 
[H, e, l, l, o, , W, o, r, l, d, !]
 
!!eval:Collections.shuffle("Hello World!".toList())
 
:O
 
!!eval:Collections.shuffle("Hello World!".toList)
 
!!eval:System.out.println("hi")
 
5:04 PM
No such property: toList for class: java.lang.String
 
!!eval:Collections.shuffle("Hello World!")
 
No signature of method: static java.util.Collections.shuffle() is applicable for argument types: (java.lang.String) values: [Hello World!]
Possible solutions: shuffle(java.util.List), shuffle(java.util.List, java.util.Random)
 
maybe we should go back to the sandbox lol
Trash some stuff ^^
 
Let's rollback two hours then?
 
Lol that's probably about right.
 
5:07 PM
192 messages moved from Java
2 messages moved from Java
??
5 messages moved from Java
 

« first day (31 days earlier)      last day (624 days later) »