Jump to content

・ ゜゜・。。・゜゜\_ö< FLAP FLAP!


Sojobo

Recommended Posts

15 minutes ago, Sojobo said:

Here's a clue

95dbdb0b185f4128a17e4fde91778268.png

bef = !bef
bang = !bang

befriendedDucks = 0



print("・ ゜゜・。。・゜゜\_ö< FLAP FLAP!")

if bef:

	print($USER + "befriended the duck in" + $TIME + "! They've befriended a total of" + befriendedDucks + "ducks")

	befriendedDucks+=1
# I forgot to add the bang D:
else:
	print($USER + "killed the duck!")
	

 

at least I tried :( i can't be assed to figure out how to do time - time that the msg was posted and i just have no idea how to add a duck to an individual user 

 

 

Edited by massi
wrote bet instead of bef
Link to comment
Just now, massi said:

bef = !bef

befriendedDucks = 0



print("・ ゜゜・。。・゜゜\_ö< FLAP FLAP!")

if bef:

      print($USER + "befriended the duck in" + $TIME + "! They've befriended a total of" + befriendedDucks + "ducks")

      befriendedDucks+=1

 

at least I tried :( i can't be assed to figure out how to do time - time that the msg was posted and i just have no idea how to add a duck to an individual user 

 

 

	                    if ((message.StartsWith("!bef") || message.StartsWith("!bf")) && aliveduck) // befriend the duck
                    {
                        int myfriends = 0;
                        m_dbConnection.Open();
                        string sql = "SELECT duckfriends FROM users WHERE guid = '" + User.SubItems[3].Text + "'";
                        SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
                        SQLiteDataReader reader = command.ExecuteReader();
                        while (reader.Read())
                            myfriends = Convert.ToInt16(reader["duckfriends"]);
	                        myfriends++;
                        b.SendCommand("say -1 [Sojobot]: " + uname + " befriended the duck in " + Math.Round((DateTime.Now - lastduck).TotalSeconds, 2) + "s! They've befriended a total of " + myfriends + " ducks"); //They've made friends with " + usersduckfriends + " ducks so far!");
                        aliveduck = false;
	                        sql = "UPDATE users SET duckfriends = " + myfriends + " WHERE guid = '" + User.SubItems[3].Text + "'";
                        command = new SQLiteCommand(sql, m_dbConnection);
                        command.ExecuteNonQuery();
                        m_dbConnection.Close();
                    }
	

massi and BlackShot like this
Link to comment
Just now, Sojobo said:

 


	                    if ((message.StartsWith("!bef") || message.StartsWith("!bf")) && aliveduck) // befriend the duck
                    {
                        int myfriends = 0;
                        m_dbConnection.Open();
                        string sql = "SELECT duckfriends FROM users WHERE guid = '" + User.SubItems[3].Text + "'";
                        SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
                        SQLiteDataReader reader = command.ExecuteReader();
                        while (reader.Read())
                            myfriends = Convert.ToInt16(reader["duckfriends"]);
	                        myfriends++;
                        b.SendCommand("say -1 [Sojobot]: " + uname + " befriended the duck in " + Math.Round((DateTime.Now - lastduck).TotalSeconds, 2) + "s! They've befriended a total of " + myfriends + " ducks"); //They've made friends with " + usersduckfriends + " ducks so far!");
                        aliveduck = false;
	                        sql = "UPDATE users SET duckfriends = " + myfriends + " WHERE guid = '" + User.SubItems[3].Text + "'";
                        command = new SQLiteCommand(sql, m_dbConnection);
                        command.ExecuteNonQuery();
                        m_dbConnection.Close();
                    }
	

 

Which language is that? Python really does seem a lot more visually friendly :D 

 

SQL seems easy :P 

Edited by massi
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...